diff --git a/AUTHORS b/AUTHORS index dcd2c205c..f7fdae950 100644 --- a/AUTHORS +++ b/AUTHORS @@ -35,6 +35,7 @@ Runrioter Wung Soroush Pour Xiaobing Jiang Xiuming Chen +Stan Putrya # Organizations diff --git a/utils.go b/utils.go index 9c97cc89c..6a26ad129 100644 --- a/utils.go +++ b/utils.go @@ -777,6 +777,10 @@ func skipLengthEncodedString(b []byte) (int, error) { // returns the number read, whether the value is NULL and the number of bytes read func readLengthEncodedInteger(b []byte) (uint64, bool, int) { + // See issue #349 + if len(b) == 0 { + return 0, true, 1 + } switch b[0] { // 251: NULL