gos7
gos7 copied to clipboard
buffer is not allocated in client.Read function
Hello,
Thank you for the S7 library. I'd like to report a bug. In the client.Read function, buffer is not allocated in line 383 as below, which causes panic while copying response.Data in client.readArea. I am not sure if it is wise to make var buffer = make([]byte, 255) in client.Read function or changing function signature to pass buffer as a parameter.
https://github.com/robinson/gos7/blob/a789e2a8c282f6d9897aceb55615e794b4445409/client.go#L374-L384