]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-bootp.c
From Albert Chin: IBM's C compiler, at least for AIX 4.3.3, doesn't
[tcpdump] / print-bootp.c
index ce1f9c6c8b5b575dfa57313e5dbb36afd04ce058..d1534c7a3d104019267a819ce17918252b6f7a2b 100644 (file)
@@ -21,8 +21,8 @@
  * Format and print bootp packets.
  */
 #ifndef lint
-static const char rcsid[] =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.74 2003-07-01 19:16:06 guy Exp $ (LBL)";
+static const char rcsid[] _U_ =
+    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.79 2005-04-20 10:30:52 guy Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -141,7 +141,7 @@ bootp_print(register const u_char *cp, u_int length)
                }
                putchar('"');
        }
-       TCHECK2(bp->bp_sname[0], 1);            /* check first char only */
+       TCHECK2(bp->bp_file[0], 1);             /* check first char only */
        if (*bp->bp_file) {
                printf("\n\t  file \"");
                if (fn_print(bp->bp_file, snapend)) {
@@ -556,6 +556,11 @@ rfc1048_print(register const u_char *bp)
                                break;
 
                        case TAG_CLIENT_FQDN:
+                               /* option 81 should be at least 4 bytes long */
+                               if (len < 4)  {
+                                        printf("ERROR: options 81 len %u < 4 bytes", len);
+                                       break;
+                               }
                                if (*bp++)
                                        printf("[svrreg]");
                                if (*bp)