gos7 icon indicating copy to clipboard operation
gos7 copied to clipboard

buffer is not allocated in client.Read function

Open ozanh opened this issue 6 years ago • 0 comments

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

ozanh avatar Jul 18 '19 08:07 ozanh