]> git.ipfire.org Git - thirdparty/freeradius-server.git/commitdiff
inet: Static buffer size
authorArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 25 May 2020 23:24:31 +0000 (18:24 -0500)
committerArran Cudbard-Bell <a.cudbardb@freeradius.org>
Mon, 25 May 2020 23:24:52 +0000 (18:24 -0500)
src/lib/util/inet.c
src/lib/util/inet.h

index 4fc922e212735ccd1fa887a88443b5029744d9c9..ad59a3b02c00020056319024ce81cf0331a6ba16 100644 (file)
@@ -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)) {
index adaaa6b2bf5c91cb7f39d1beb2dc43539c045a5a..4c4e117ea29153ea785d0911fca336b53221e1b6 100644 (file)
@@ -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