X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/4189fb7df651e5742b15488d2f59dae5f526e82b..1ee09c1510704191a14df4eb914dba3d5dc9ab58:/print-ppp.c diff --git a/print-ppp.c b/print-ppp.c index 84429012..603dd6c4 100644 --- a/print-ppp.c +++ b/print-ppp.c @@ -31,7 +31,7 @@ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.108 2005-04-06 21:32:42 mcr Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.109 2005-04-20 22:15:17 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -872,6 +872,16 @@ handle_pap(const u_char *p, int length) len = EXTRACT_16BITS(p); p += 2; + if ((int)len > length) { + printf(", length %u > packet size", len); + return; + } + length = len; + if (length < (p - p0)) { + printf(", length %u < PAP header length", length); + return; + } + switch (code) { case PAP_AREQ: if (length - (p - p0) < 1)