]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
Brad Spencer found and fixed three flaws in the code, found with the new
authorDaniel Stenberg <daniel@haxx.se>
Sat, 2 Jun 2007 20:09:23 +0000 (20:09 +0000)
committerDaniel Stenberg <daniel@haxx.se>
Sat, 2 Jun 2007 20:09:23 +0000 (20:09 +0000)
gcc 4.2.0 warning: -Waddress

ares/AUTHORS
ares/CHANGES
ares/ares_init.c

index f744914cd8892f0c647fb4a522bc098a75949b58..0931f3719bfed8aa0064f28d003f4e9e4ab5094a 100644 (file)
@@ -25,3 +25,4 @@ Vlad Dinulescu
 Brad House
 Shmulik Regev
 Ashish Sharma
+Brad Spencer
index 944255e2e45c624d4ef378a76cdcb0d6ecfd1664..fd14d3e27ab4083cefb9b935311245089a1cceb4 100644 (file)
@@ -2,6 +2,9 @@
 
 * June 2 2007
 
+- Brad Spencer found and fixed three flaws in the code, found with the new
+  gcc 4.2.0 warning: -Waddress
+
 - Brad House fixed VS2005 compiler warnings due to time_t being 64bit.
   He also made recent Microsoft compilers use _strdup() instead of strdup().
 
index efde9677268b3d6bc4327b0086c935484f862125..c9faf45a0400d665c3f71d40566006b8709f7644 100644 (file)
@@ -1059,7 +1059,7 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
         ipbufpfx[0] = '\0';
       /* Lets see if it is CIDR */
       /* First we'll try IPv6 */
-      if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx ? ipbufpfx : ipbuf,
+      if ((bits = ares_inet_net_pton(AF_INET6, ipbufpfx[0] ? ipbufpfx : ipbuf,
                                      &pat.addr.addr6,
                                      sizeof(pat.addr.addr6))) > 0)
         {
@@ -1069,7 +1069,7 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
           if (!sortlist_alloc(sortlist, nsort, &pat))
             return ARES_ENOMEM;
         }
-      if (ipbufpfx &&
+      if (ipbufpfx[0] &&
           (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addr.addr4,
                                      sizeof(pat.addr.addr4))) > 0)
         {
@@ -1082,7 +1082,7 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
       /* See if it is just a regular IP */
       else if (ip_addr(ipbuf, (int)(q-str), &pat.addr.addr4) == 0)
         {
-          if (ipbufpfx)
+          if (ipbufpfx[0])
             {
               memcpy(ipbuf, str, (int)(q-str));
               ipbuf[(int)(q-str)] = '\0';