Return empty string when can't take slice for snippet from buffer

This commit is contained in:
Waldemar Quevedo
2015-11-29 20:47:47 -08:00
parent 18f932620f
commit 498df401af

View File

@@ -663,7 +663,7 @@ parseErr:
func protoSnippet(start int, buf []byte) string {
stop := start + PROTO_SNIPPET_SIZE
bufSize := len(buf)
if start == bufSize {
if start <= bufSize {
return ""
}
if stop > bufSize {