]> The Tcpdump Group git mirrors - tcpdump/blobdiff - print-ether.c
Fail if nd_push_buffer() or nd_push_snaplen() fails.
[tcpdump] / print-ether.c
index 976ab4b696f56a2d30847f8d152dae27d5071057..cd623f9025687a95bb7e166bdf98e516cb0ea30d 100644 (file)
@@ -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");