X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/fe9b593bac67c5485579ab89f21dd9e4490799fc..83d4b79552e6cb779bc5214cdeb84f2c96ffc43e:/print-ip.c diff --git a/print-ip.c b/print-ip.c index 4f9617a3..23ba99c9 100644 --- a/print-ip.c +++ b/print-ip.c @@ -377,7 +377,10 @@ ip_print(netdissect_options *ndo, /* * Cut off the snapshot length to the end of the IP payload. */ - nd_push_snaplen(ndo, bp, len); + if (!nd_push_snaplen(ndo, bp, len)) { + (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, + "%s: can't push snaplen on buffer stack", __func__); + } len -= hlen;