X-Git-Url: https://git.tcpdump.org/tcpdump/blobdiff_plain/9083c1c58a1b181c667475ffbbc75c1cea8936c3..0a7b2e9975677473b51c77b1cd41a93ff06efeba:/print-ether.c?ds=sidebyside diff --git a/print-ether.c b/print-ether.c index 976ab4b6..cd623f90 100644 --- a/print-ether.c +++ b/print-ether.c @@ -306,7 +306,10 @@ recurse: * Cut off the snapshot length to the end of the * payload. */ - nd_push_snapend(ndo, p + length); + if (!nd_push_snaplen(ndo, p, length)) { + (*ndo->ndo_error)(ndo, S_ERR_ND_MEM_ALLOC, + "%s: can't push snaplen on buffer stack", __func__); + } if (ndo->ndo_eflag) { ND_PRINT("802.3");