]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Another length check, also found by the Clang Static Analyzer.
authorGuy Harris <[email protected]>
Thu, 16 Jan 2014 21:12:06 +0000 (13:12 -0800)
committerGuy Harris <[email protected]>
Thu, 16 Jan 2014 21:12:06 +0000 (13:12 -0800)
print-ppp.c

index 5142e07b0c52c524bcd3c1e5981b631be5761e2a..f19a03b100ee277709486371d437b354c0e75769 100644 (file)
@@ -1265,6 +1265,9 @@ ppp_hdlc(const u_char *p, int length)
        int i, proto;
        const void *se;
 
+        if (length <= 0)
+                return;
+
        b = (u_int8_t *)malloc(length);
        if (b == NULL)
                return;