]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fencepost error. 290/head
authorsfd <[email protected]>
Tue, 16 Apr 2013 02:54:03 +0000 (14:54 +1200)
committersfd <[email protected]>
Tue, 16 Apr 2013 02:54:03 +0000 (14:54 +1200)
If an ERF record has 0 'payload' bytes the last extension header will not be counted and the header length will be calculated incorrectly.

pcap-dag.c

index 847a556f41b6ab5068782f43586edc22917142d5..1ce0b732f9d5395251c10525cc6603ca0fada927 100644 (file)
@@ -202,7 +202,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 */