]> git.openfabrics.org - ~shefty/ibacm.git/commitdiff
Increase buffer space for inet_ntop from 32 to INET6_ADDRSTRLEN
authorHal Rosenstock <hal@mellanox.com>
Wed, 19 Jun 2013 17:08:20 +0000 (20:08 +0300)
committerSean Hefty <sean.hefty@intel.com>
Thu, 27 Jun 2013 20:07:44 +0000 (13:07 -0700)
Signed-off-by: Hal Rosenstock <hal@mellanox.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
linux/acme_linux.c
src/acm.c

index 1039645ec9e6665ec23db75a39603696a7c29d69..ef5b10714168cc9420ae9fe21c4c18bc1bac717a 100644 (file)
@@ -149,7 +149,7 @@ int gen_addr_ip(FILE *f)
 {
        struct ifconf *ifc;
        struct ifreq *ifr;
-       char ip[sizeof "ffff:ffff:ffff:ffff:ffff:ffff:ffff:ffff"];
+       char ip[INET6_ADDRSTRLEN];
        int s, ret, dev_index, i, len;
        uint16_t pkey;
        uint8_t port;
index 15925ba0796214639fdfef18f6673078b480f569..726acb805841b283f6e28b46cd87673f54ea91bb 100644 (file)
--- a/src/acm.c
+++ b/src/acm.c
@@ -2795,7 +2795,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
        FILE *faddr;
        char *dev_name;
        char s[120];
-       char dev[32], addr[32], pkey_str[8];
+       char dev[32], addr[INET6_ADDRSTRLEN], pkey_str[8];
        uint16_t pkey;
        uint8_t type;
        int port, index = 0;
@@ -2814,7 +2814,7 @@ static int acm_assign_ep_names(struct acm_ep *ep)
                if (s[0] == '#')
                        continue;
 
-               if (sscanf(s, "%32s%32s%d%8s", addr, dev, &port, pkey_str) != 4)
+               if (sscanf(s, "%46s%32s%d%8s", addr, dev, &port, pkey_str) != 4)
                        continue;
 
                acm_log(2, "%s", s);