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-chdlc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'print-chdlc.c') diff --git a/print-chdlc.c b/print-chdlc.c index bc431774..a7793351 100644 --- a/print-chdlc.c +++ b/print-chdlc.c @@ -169,8 +169,8 @@ chdlc_slarp_print(netdissect_options *ndo, const u_char *cp, u_int length) break; case SLARP_REPLY: ND_PRINT("reply %s/%s", - ipaddr_string(ndo, slarp->un.addr.addr), - ipaddr_string(ndo, slarp->un.addr.mask)); + GET_IPADDR_STRING(slarp->un.addr.addr), + GET_IPADDR_STRING(slarp->un.addr.mask)); break; case SLARP_KEEPALIVE: ND_PRINT("keepalive: mineseen=0x%08x, yourseen=0x%08x, reliability=0x%04x", -- cgit v1.2.1