]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fencepost error.
authorsfd <[email protected]>
Tue, 16 Apr 2013 02:54:03 +0000 (14:54 +1200)
committerGuy Harris <[email protected]>
Mon, 6 May 2013 21:32:16 +0000 (14:32 -0700)
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 d006aa61ca15205e364791fa6de9829866954415..1a1ed18ff5b3e2a65f9fa593374e64bff9428424 100644 (file)
@@ -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 */