X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/544802f1839926d09f6d15743df54f206b6d7990..a5370b71fe0fdecac8a10ad2e0e5545f01f95f6e:/print-bootp.c diff --git a/print-bootp.c b/print-bootp.c index cde86456..8217a6f2 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -22,7 +22,7 @@ */ #ifndef lint static const char rcsid[] _U_ = - "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.78 2004-03-02 07:38:10 hannes Exp $ (LBL)"; + "@(#) $Header: /tcpdump/master/tcpdump/print-bootp.c,v 1.80 2005-05-06 04:19:25 guy Exp $ (LBL)"; #endif #ifdef HAVE_CONFIG_H @@ -444,7 +444,10 @@ rfc1048_print(register const u_char *bp) 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; @@ -557,16 +560,20 @@ rfc1048_print(register const u_char *bp) case TAG_CLIENT_FQDN: /* option 81 should be at least 4 bytes long */ - if (len < 4) + 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; @@ -577,7 +584,10 @@ rfc1048_print(register const u_char *bp) 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;