aboutsummaryrefslogtreecommitdiff
path: root/ares
diff options
context:
space:
mode:
authorDaniel Stenberg <daniel@haxx.se>2007-06-02 20:09:23 +0000
committerDaniel Stenberg <daniel@haxx.se>2007-06-02 20:09:23 +0000
commit25d2a27c647eb387614f7a1c255fc9b952330359 (patch)
tree0ab1fb2b41e784cc6ebd5373e4a059d512f35590 /ares
parentb084dc87600e8f1ab8a583f7f6b52b5c332d91b3 (diff)
Brad Spencer found and fixed three flaws in the code, found with the new
gcc 4.2.0 warning: -Waddress
Diffstat (limited to 'ares')
-rw-r--r--ares/AUTHORS1
-rw-r--r--ares/CHANGES3
-rw-r--r--ares/ares_init.c6
3 files changed, 7 insertions, 3 deletions
diff --git a/ares/AUTHORS b/ares/AUTHORS
index f744914cd..0931f3719 100644
--- a/ares/AUTHORS
+++ b/ares/AUTHORS
@@ -25,3 +25,4 @@ Vlad Dinulescu
Brad House
Shmulik Regev
Ashish Sharma
+Brad Spencer
diff --git a/ares/CHANGES b/ares/CHANGES
index 944255e2e..fd14d3e27 100644
--- a/ares/CHANGES
+++ b/ares/CHANGES
@@ -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().
diff --git a/ares/ares_init.c b/ares/ares_init.c
index efde96772..c9faf45a0 100644
--- a/ares/ares_init.c
+++ b/ares/ares_init.c
@@ -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';