]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ip.c
Makefile.in: don't remove configure and config.h.in in make distclean.
[tcpdump] / print-ip.c
index a0df95918898ff3228e760d0c07942790d3e3074..23ba99c970075099b9e5a80a598967e2c4081b6e 100644 (file)
@@ -377,7 +377,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;