summaryrefslogtreecommitdiff
path: root/ares_init.c
diff options
context:
space:
mode:
authorDima Tisnek <dimaqq@gmail.com>2011-02-16 23:43:49 +0100
committerDaniel Stenberg <daniel@haxx.se>2011-02-16 23:44:36 +0100
commite14f136aa3415e28f01f7dd1c1497ddafecd3af5 (patch)
tree7ed142d1c0fc2a63c4a3c62e5a0901ec18733dfb /ares_init.c
parentdec9f79d0a2d9e9bd92e520b97a2243b69975316 (diff)
downloadc-ares-e14f136aa3415e28f01f7dd1c1497ddafecd3af5.tar.gz
c-ares-e14f136aa3415e28f01f7dd1c1497ddafecd3af5.tar.bz2
c-ares-e14f136aa3415e28f01f7dd1c1497ddafecd3af5.zip
config_sortlist: (win32) missing else
Without an else there, contents of "pat" that could have been successfully set just above, may be clobbered by successive unsuccessful calls to "xxx_pton" or "ip_addr".
Diffstat (limited to 'ares_init.c')
-rw-r--r--ares_init.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/ares_init.c b/ares_init.c
index d2f4a72..4c54c86 100644
--- a/ares_init.c
+++ b/ares_init.c
@@ -1292,9 +1292,9 @@ static int config_sortlist(struct apattern **sortlist, int *nsort,
if (!sortlist_alloc(sortlist, nsort, &pat))
return ARES_ENOMEM;
}
- if (ipbufpfx[0] &&
- (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
- sizeof(pat.addrV4))) > 0)
+ else if (ipbufpfx[0] &&
+ (bits = ares_inet_net_pton(AF_INET, ipbufpfx, &pat.addrV4,
+ sizeof(pat.addrV4))) > 0)
{
pat.type = PATTERN_CIDR;
pat.mask.bits = (unsigned short)bits;