*
* Format and print bootp packets.
*/
+#ifndef lint
+static const char rcsid[] _U_ =
+ "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.78.2.2 2005-05-06 04:19:39 guy Exp $ (LBL)";
+#endif
#ifdef HAVE_CONFIG_H
#include "config.h"
#include "ether.h"
#include "bootp.h"
-#ifndef lint
-static const char rcsid[] _U_ =
- "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.76 2003-11-15 00:39:17 guy Exp $ (LBL)";
-#endif
static void rfc1048_print(const u_char *);
static void cmu_print(const u_char *);
case 'a':
/* ascii strings */
putchar('"');
- (void)fn_printn(bp, size, NULL);
+ if (fn_printn(bp, size, snapend)) {
+ putchar('"');
+ goto trunc;
+ }
putchar('"');
bp += size;
size = 0;
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)
printf("%u/%u/", *bp, *(bp+1));
bp += 2;
putchar('"');
- (void)fn_printn(bp, size - 3, NULL);
+ if (fn_printn(bp, size - 3, snapend)) {
+ putchar('"');
+ goto trunc;
+ }
putchar('"');
bp += size - 3;
size = 0;
size--;
if (type == 0) {
putchar('"');
- (void)fn_printn(bp, size, NULL);
+ if (fn_printn(bp, size, snapend)) {
+ putchar('"');
+ goto trunc;
+ }
putchar('"');
bp += size;
size = 0;