]> The Tcpdump Group git mirrors - tcpdump/commitdiff
If decode_prefix6() returns a negative number, don't print buf.
authorGuy Harris <[email protected]>
Sat, 1 Jun 2019 21:42:09 +0000 (14:42 -0700)
committerGuy Harris <[email protected]>
Sat, 1 Jun 2019 21:42:09 +0000 (14:42 -0700)
If it returns a negative number, it hasn't necessarily filled in buf, so
just return immediately; this is similar to the IPv4 code path, wherein
we just return a negative number, and print nothing, on an error.

This should fix GitHub issue #763.

print-hncp.c

index 8be59e37ea9fbf53cfbd784446f1be29fe3e193c..3a3c01ea2fa2d01ec3ba4d71eb79e3ab7892ef05 100644 (file)
@@ -231,6 +231,8 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length)
         plenbytes += 1 + IPV4_MAPPED_HEADING_LEN;
     } else {
         plenbytes = decode_prefix6(ndo, prefix, max_length, buf, sizeof(buf));
+        if (plenbytes < 0)
+            return plenbytes;
     }
 
     ND_PRINT("%s", buf);