Skip to content

Commit

Permalink
Fix range check to avoid index out of range panic
Browse files Browse the repository at this point in the history
  • Loading branch information
divergentdave committed Mar 13, 2017
1 parent c36b858 commit 558797a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion parser/parser.go
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down

0 comments on commit 558797a

Please sign in to comment.