From 306c2a0384af923a73bf234f3c8bc186ceff0b58 Mon Sep 17 00:00:00 2001 From: Guy Harris Date: Sun, 19 Jan 2020 19:55:38 -0800 Subject: More bounds checking when fetching addresses and converting to strings. Replace more calls to ipaddr_string()/ip6addr_string() with calls to GET_IPADDR_STRING()/GET_IP6ADDR_STRING() macros performing bounds checking. Add similar bounds-checking inline functions and macros to wrap linkaddr_string(), etheraddr_string(), and isonsap_string() and convert calls to them to use the macros as well. Shuffle the inline functions in addrtoname.h around a bit, so that the inline functions, external declarations, and macros are all in the same order. --- print-ip6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'print-ip6.c') diff --git a/print-ip6.c b/print-ip6.c index a1802b1e..fd28cb23 100644 --- a/print-ip6.c +++ b/print-ip6.c @@ -333,8 +333,8 @@ ip6_print(netdissect_options *ndo, const u_char *bp, u_int length) if (cp == (const u_char *)(ip6 + 1) && nh != IPPROTO_TCP && nh != IPPROTO_UDP && nh != IPPROTO_DCCP && nh != IPPROTO_SCTP) { - ND_PRINT("%s > %s: ", ip6addr_string(ndo, ip6->ip6_src), - ip6addr_string(ndo, ip6->ip6_dst)); + ND_PRINT("%s > %s: ", GET_IP6ADDR_STRING(ip6->ip6_src), + GET_IP6ADDR_STRING(ip6->ip6_dst)); } switch (nh) { -- cgit v1.2.1