]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Add another check, and fix a check.
authorguy <guy>
Wed, 24 Mar 2004 06:00:51 +0000 (06:00 +0000)
committerguy <guy>
Wed, 24 Mar 2004 06:00:51 +0000 (06:00 +0000)
print-cdp.c

index 8e2ee11b317c8d85b8cc586a9a86bb7e5a7711fd..195c637f52e6c54be3ae38f1dfa89a2af3586c73 100644 (file)
@@ -26,7 +26,7 @@
 
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.19.2.4 2004-03-24 00:41:33 guy Exp $";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-cdp.c,v 1.19.2.5 2004-03-24 06:00:51 guy Exp $";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -243,11 +243,12 @@ cdp_print_addr(const u_char * p, int l)
        };
 #endif
 
+       TCHECK2(*p, 2);
        num = EXTRACT_32BITS(p);
        p += 4;
 
        while (p < endp && num >= 0) {
-               TCHECK2(p, 2);
+               TCHECK2(*p, 2);
                if (p + 2 > endp)
                        goto trunc;
                pt = p[0];              /* type of "protocol" field */