Update sniff parser to fix index out of bound error

This commit is contained in:
Manuel de Brito Fontes 2017-05-26 14:25:06 -04:00
parent e4c4b22c73
commit 20e99fa409
4 changed files with 41 additions and 37 deletions

View file

@ -85,7 +85,7 @@ func GetSNBlock(data []byte) ([]byte, error) {
data = data[2 : extensionLength+2]
for {
if index >= len(data) {
if index+4 >= len(data) {
break
}
length := int((data[index+2] << 8) + data[index+3])