|Main Archive Page > Month Archives > wireshark-dev archives|
epan/ftypes/ftype_bytes.c:ipv6_repr_len() returns 39 which is length of:
But it's common to have INET6_ADDRSTRLEN defined to 46, which I believe is
length of "ffff:ffff:ffff:ffff:ffff:ffff:255.255.255.255" + 1 byte for NUL.
IMHO when IPv4-mapping is used the longest address is:
Anyone knows inet_ntop(AF_INET6, ..) implementation which can actually use 46 bytes?
I'm asking because current code can lead to buffer overlow:
ip6_to_str_buf((struct e_in6_addr *)fv->value.bytes->data, buf); ->
inet_ntop(AF_INET6, (const guchar*)ad, buf, INET6_ADDRSTRLEN);
I'm planning to fix it by #define MAX_IPV6_STR_LEN inside to_str.h (like we do for other addresses),
but should it be 40 or 46 (or defined to INET6_ADDRSTRLEN)?
Sent via: Wireshark-dev mailing list <email@example.com>