From: Arran Cudbard-Bell Date: Mon, 25 May 2020 23:24:31 +0000 (-0500) Subject: inet: Static buffer size X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=261d0b9fac5ac867839f50cdf85c6c7057fa35bd;p=thirdparty%2Ffreeradius-server.git inet: Static buffer size --- diff --git a/src/lib/util/inet.c b/src/lib/util/inet.c index 4fc922e2127..ad59a3b02c0 100644 --- a/src/lib/util/inet.c +++ b/src/lib/util/inet.c @@ -900,7 +900,7 @@ do_port: * - NULL on error (use fr_syserror(errno)). * - a pointer to out on success. */ -char *fr_inet_ntop(char out[FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr) +char *fr_inet_ntop(char out[static FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr) { char *p; size_t len; @@ -955,7 +955,7 @@ char *fr_inet_ntop(char out[FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const * - NULL on error (use fr_syserror(errno)). * - a pointer to out on success. */ -char *fr_inet_ntop_prefix(char out[FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr) +char *fr_inet_ntop_prefix(char out[static FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr) { char *p; size_t len; @@ -1106,7 +1106,7 @@ int fr_ipaddr_from_ifname(UNUSED fr_ipaddr_t *out, UNUSED int af, char const *na * - NULL on error. * - a pointer to out on success. */ -char *fr_ifname_from_ifindex(char out[IFNAMSIZ], int if_index) +char *fr_ifname_from_ifindex(char out[static IFNAMSIZ], int if_index) { #ifdef HAVE_IF_INDEXTONAME if (!if_indextoname(if_index, out)) { diff --git a/src/lib/util/inet.h b/src/lib/util/inet.h index adaaa6b2bf5..4c4e117ea29 100644 --- a/src/lib/util/inet.h +++ b/src/lib/util/inet.h @@ -116,9 +116,9 @@ int fr_inet_pton(fr_ipaddr_t *out, char const *value, ssize_t inlen, int af, boo int fr_inet_pton_port(fr_ipaddr_t *out, uint16_t *port_out, char const *value, ssize_t inlen, int af, bool resolve, bool mask); -char *fr_inet_ntop(char out[FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr); +char *fr_inet_ntop(char out[static FR_IPADDR_STRLEN], size_t outlen, fr_ipaddr_t const *addr); -char *fr_inet_ntop_prefix(char out[FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr); +char *fr_inet_ntop_prefix(char out[static FR_IPADDR_PREFIX_STRLEN], size_t outlen, fr_ipaddr_t const *addr); char *fr_inet_ifid_ntop(char *out, size_t outlen, uint8_t const *ifid); @@ -130,7 +130,7 @@ uint8_t *fr_inet_ifid_pton(uint8_t out[static 8], char const *ifid_str); int fr_ipaddr_from_ifname(fr_ipaddr_t *out, int af, char const *name); #ifdef WITH_IFINDEX_NAME_RESOLUTION -char *fr_ifname_from_ifindex(char out[IFNAMSIZ], int if_index); +char *fr_ifname_from_ifindex(char out[static IFNAMSIZ], int if_index); #endif #ifdef WITH_IFINDEX_IPADDR_RESOLUTION