Skip to content

Commit

Permalink
Fencepost error.
Browse files Browse the repository at this point in the history
If an ERF record has 0 'payload' bytes the last extension header will not be counted and the header length will be calculated incorrectly.
  • Loading branch information
sfd authored and guyharris committed May 6, 2013
1 parent 12f8f68 commit db2ef8d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion pcap-dag.c
Original file line number Diff line number Diff line change
Expand Up @@ -225,7 +225,7 @@ dag_erf_ext_header_count(uint8_t * erf, size_t len)
do {

/* sanity check we have enough bytes */
if ( len <= (24 + (hdr_num * 8)) )
if ( len < (24 + (hdr_num * 8)) )
return hdr_num;

/* get the header type */
Expand Down

0 comments on commit db2ef8d

Please sign in to comment.