]> The Tcpdump Group git mirrors - tcpdump/commitdiff
From: alex medvedev <[email protected]>
authorhannes <hannes>
Tue, 2 Mar 2004 07:45:13 +0000 (07:45 +0000)
committerhannes <hannes>
Tue, 2 Mar 2004 07:45:13 +0000 (07:45 +0000)
catch a segfault:
  option 81 min size should be 4 bytes:
    http://sunsite.uakom.sk/doc/rfc/bootp-dhcp-option-81

print-bootp.c

index c586930478b0cefeb2cfa1aea32eb6041135a082..2727e877740fe454ccb53ba92d1667faf89fbf22 100644 (file)
@@ -22,7 +22,7 @@
  */
 #ifndef lint
 static const char rcsid[] _U_ =
  */
 #ifndef lint
 static const char rcsid[] _U_ =
-    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.75.2.2 2003-11-16 08:51:13 guy Exp $ (LBL)";
+    "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.75.2.3 2004-03-02 07:45:13 hannes Exp $ (LBL)";
 #endif
 
 #ifdef HAVE_CONFIG_H
 #endif
 
 #ifdef HAVE_CONFIG_H
@@ -556,6 +556,10 @@ rfc1048_print(register const u_char *bp)
                                break;
 
                        case TAG_CLIENT_FQDN:
                                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)
                                if (*bp++)
                                        printf("[svrreg]");
                                if (*bp)