From 8ec071f59c1d7b51d3acc852945dcf7d3fc0f68d Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Thu, 16 Jan 2014 13:12:06 -0800 Subject: [PATCH] Another length check, also found by the Clang Static Analyzer. --- print-ppp.c | 3 +++ 1 file changed, 3 insertions(+) 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; -- 2.39.5