X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/1fb5643f91a91fe00428a6a0a0c256ba0fd2ad59..b016347e5bb2d189de7e40ae3ceb9897a53b32d8:/print-ip.c diff --git a/print-ip.c b/print-ip.c index a0df9591..f90c58a0 100644 --- a/print-ip.c +++ b/print-ip.c @@ -363,8 +363,7 @@ ip_print(netdissect_options *ndo, if (len) { ND_PRINT("bad-len %u", len); return; - } - else { + } else { /* we guess that it is a TSO send */ len = length; } @@ -377,7 +376,10 @@ ip_print(netdissect_options *ndo, /* * Cut off the snapshot length to the end of the IP payload. */ - nd_push_snapend(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;