-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Closed
Description
If the return byte slice is scanned into a sql.RawBytes, seems like an append() could overwrite other values.
Lines 529 to 543 in 02eb68a
func readLengthEncodedString(b []byte) ([]byte, bool, int, error) { | |
// Get length | |
num, isNull, n := readLengthEncodedInteger(b) | |
if num < 1 { | |
return b[n:n], isNull, n, nil | |
} | |
n += int(num) | |
// Check data length | |
if len(b) >= n { | |
return b[n-int(num) : n], false, n, nil | |
} | |
return nil, false, n, io.EOF | |
} |