Skip to content

Commit

Permalink
Merge pull request cloudflare#65 from netsampler/bugfix/offset
Browse files Browse the repository at this point in the history
Bugfix: index out of range in some cases
  • Loading branch information
lspgn authored Jan 6, 2022
2 parents 4308c48 + 2786369 commit 20e8e56
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion producer/producer_sf.go
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ func ParseEthernetHeader(flowMessage *flowmessage.FlowMessage, data []byte, conf
appOffset = 8
}

if len(data) >= offset+13 && nextHeader == 6 {
if len(data) > offset+13 && nextHeader == 6 {
tcpflags = data[offset+13]

appOffset = int(data[13]>>4) * 4
Expand Down

0 comments on commit 20e8e56

Please sign in to comment.