]> The Tcpdump Group git mirrors - tcpdump/commitdiff
HNCP: Add a comment about "don't use GET_IPADDR_STRING()"
authorFrancois-Xavier Le Bail <[email protected]>
Sat, 5 Feb 2022 18:01:52 +0000 (19:01 +0100)
committerFrancois-Xavier Le Bail <[email protected]>
Sat, 5 Feb 2022 18:06:24 +0000 (19:06 +0100)
print-hncp.c

index b288160d6efcb8d8ea44c92141b69c7891b5b2f9..37c13ec3469cc308d199e346d040a62b3d3952cf 100644 (file)
@@ -226,7 +226,7 @@ print_prefix(netdissect_options *ndo, const u_char *prefix, u_int max_length)
                ((u_char *)&addr)[plenbytes - 1] &=
                        ((0xff00 >> (plen % 8)) & 0xff);
        }
-       snprintf(buf, sizeof(buf), "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen);
+       snprintf(buf, sizeof(buf), "%s/%u", ipaddr_string(ndo, (const u_char *)&addr), plen); /* local buffer, not packet data; don't use GET_IPADDR_STRING() */
         plenbytes += 1 + IPV4_MAPPED_HEADING_LEN;
     } else {
         plenbytes = decode_prefix6(ndo, prefix, max_length, buf, sizeof(buf));