Closed jbreich closed 2 years ago
I noticed that when using the library with bufio I get a segfault when the connection is closed. This is due to the returned value from the Read operation which is negative. Indeed, bufio is protected against that: https://github.com/golang/go/blob/master/src/bufio/bufio.go#L108 Also, from the Read documentation, n should be 0 <= n <= len(p) (https://github.com/golang/go/blob/master/src/io/io.go#L58)
The modification I have done is really simple, it is just re-assigning n to zero in case of error (negative value)
@jbreich, thanks for the PR. Should we do the same on srtSendMsg2Impl to keep consistency?
You are right I am doing the modification
Huge thanks!
I noticed that when using the library with bufio I get a segfault when the connection is closed. This is due to the returned value from the Read operation which is negative. Indeed, bufio is protected against that: https://github.com/golang/go/blob/master/src/bufio/bufio.go#L108 Also, from the Read documentation, n should be 0 <= n <= len(p) (https://github.com/golang/go/blob/master/src/io/io.go#L58)
The modification I have done is really simple, it is just re-assigning n to zero in case of error (negative value)