]> The Tcpdump Group git mirrors - tcpdump/commitdiff
Fix the code to handle the Password Authentication Protocol
authorguy <guy>
Sun, 24 Sep 2000 08:08:56 +0000 (08:08 +0000)
committerguy <guy>
Sun, 24 Sep 2000 08:08:56 +0000 (08:08 +0000)
Authenticate-Ack and Authenticate-Nak packets to do a length check based
on "msg_len", which we set in that case, rather than "passwd_len", which
we don't.  Thanks and a tip of the Hatlo Hat to some non-GCC compiler -
I forget which one - that noticed that we were using a variable which
we hadn't necessarily set.

print-ppp.c

index ee8160d371d0a4c9251d80ee95e21789d8d7dae5..e66717eca73aa15db0e2f0426b4218417447b857 100644 (file)
@@ -31,7 +31,7 @@
 
 #ifndef lint
 static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.47 2000-09-23 08:54:37 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-ppp.c,v 1.48 2000-09-24 08:08:56 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -736,7 +736,7 @@ handle_chap(const u_char *p, int length)
        }
 }
 
-/* PAP */
+/* PAP (see RFC 1334) */
 static void
 handle_pap(const u_char *p, int length)
 {
@@ -798,7 +798,7 @@ handle_pap(const u_char *p, int length)
                        return;
                msg_len = *p;           /* Msg-Length */
                p++;
-               if (length - (p - p0) < passwd_len)
+               if (length - (p - p0) < msg_len)
                        return;
                printf(", Msg=");
                for (i = 0; i< msg_len; i++)