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-rpki-rtr.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'print-rpki-rtr.c') diff --git a/print-rpki-rtr.c b/print-rpki-rtr.c index 7457a16c..a51c4a1f 100644 --- a/print-rpki-rtr.c +++ b/print-rpki-rtr.c @@ -265,7 +265,7 @@ rpki_rtr_pdu_print(netdissect_options *ndo, const u_char *tptr, const u_int len, pdu = (const rpki_rtr_pdu_ipv4_prefix *)tptr; ND_PRINT("%sIPv4 Prefix %s/%u-%u, origin-as %u, flags 0x%02x", indent_string(indent+2), - ipaddr_string(ndo, pdu->prefix), + GET_IPADDR_STRING(pdu->prefix), GET_U_1(pdu->prefix_length), GET_U_1(pdu->max_length), GET_BE_U_4(pdu->as), GET_U_1(pdu->flags)); } @@ -281,7 +281,7 @@ rpki_rtr_pdu_print(netdissect_options *ndo, const u_char *tptr, const u_int len, pdu = (const rpki_rtr_pdu_ipv6_prefix *)tptr; ND_PRINT("%sIPv6 Prefix %s/%u-%u, origin-as %u, flags 0x%02x", indent_string(indent+2), - ip6addr_string(ndo, pdu->prefix), + GET_IP6ADDR_STRING(pdu->prefix), GET_U_1(pdu->prefix_length), GET_U_1(pdu->max_length), GET_BE_U_4(pdu->as), GET_U_1(pdu->flags)); } -- cgit v1.2.1