From: Guy Harris Date: Thu, 16 Jan 2014 21:12:06 +0000 (-0800) Subject: Another length check, also found by the Clang Static Analyzer. X-Git-Tag: tcpdump-4.6.0~270 X-Git-Url: https://git.tcpdump.org/tcpdump/commitdiff_plain/8ec071f59c1d7b51d3acc852945dcf7d3fc0f68d Another length check, also found by the Clang Static Analyzer. --- diff --git a/print-ppp.c b/print-ppp.c index 5142e07b..f19a03b1 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -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;