X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/6cdbddabf8cbddb872f347353a494b4d62d07e4e..refs/pull/482/head:/print-bootp.c diff --git a/print-bootp.c b/print-bootp.c index 27438fab..83fa0278 100644 --- a/print-bootp.c +++ b/print-bootp.c @@ -21,16 +21,15 @@ * Format and print bootp packets. */ -#define NETDISSECT_REWORKED #ifdef HAVE_CONFIG_H #include "config.h" #endif -#include +#include #include -#include "interface.h" +#include "netdissect.h" #include "addrtoname.h" #include "extract.h" @@ -851,7 +850,7 @@ rfc1048_print(netdissect_options *ndo, case TAG_CLIENT_ID: { - int type; + int type; /* this option should be at least 1 byte long */ if (len < 1) { @@ -907,7 +906,8 @@ rfc1048_print(netdissect_options *ndo, case AGENT_SUBOPTION_CIRCUIT_ID: /* fall through */ case AGENT_SUBOPTION_REMOTE_ID: case AGENT_SUBOPTION_SUBSCRIBER_ID: - fn_printn(ndo, bp, suboptlen, NULL); + if (fn_printn(ndo, bp, suboptlen, ndo->ndo_snapend)) + goto trunc; break; default: @@ -996,7 +996,7 @@ rfc1048_print(netdissect_options *ndo, break; } if (len < suboptlen) { - ND_PRINT((ndo, "ERROR: malformed option")); + ND_PRINT((ndo, "ERROR: invalid option")); bp += len; len = 0; break;