We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 050b90b + 6b97675 commit 7832e4bCopy full SHA for 7832e4b
frame.go
@@ -1938,14 +1938,14 @@ func (f *framer) readInetAdressOnly() net.IP {
1938
panic(fmt.Errorf("invalid IP size: %d", size))
1939
}
1940
1941
- if len(f.buf) < 1 {
+ if len(f.buf) < int(size) {
1942
panic(fmt.Errorf("not enough bytes in buffer to read inet require %d got: %d", size, len(f.buf)))
1943
1944
1945
- ip := make([]byte, size)
+ ip := make(net.IP, size)
1946
copy(ip, f.buf[:size])
1947
f.buf = f.buf[size:]
1948
- return net.IP(ip)
+ return ip
1949
1950
1951
func (f *framer) readInet() (net.IP, int) {
0 commit comments