From: Henrik Nordstrom Date: Wed, 13 Aug 2008 14:49:32 +0000 (+0200) Subject: Cleanup ip based acl parser to be more explicit about what it does and properly detec... X-Git-Tag: SQUID_3_1_0_1~49^2~84 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f8d0a1ef37e04e24734f6ae1e29baf05ccb25f30;p=thirdparty%2Fsquid.git Cleanup ip based acl parser to be more explicit about what it does and properly detect malformed addresses --- diff --git a/src/ACLIP.cc b/src/ACLIP.cc index 999986629e..28c6534879 100644 --- a/src/ACLIP.cc +++ b/src/ACLIP.cc @@ -372,22 +372,22 @@ acl_ip_data::FactoryParse(const char *t) #endif /* Decode addr1 */ - if (!*addr1) { + if (!*addr1 || !(q->addr1 = addr1)) { debugs(28, 0, "aclIpParseIpData: unknown first address in '" << t << "'"); delete q; self_destruct(); return NULL; } - else q->addr1 = addr1; /* Decode addr2 */ - if (*addr2 && !(q->addr2=addr2) ) { + if (!*addr2) + q->addr2.SetAnyAddr(); + else if (!(q->addr2=addr2) ) { debugs(28, 0, "aclIpParseIpData: unknown second address in '" << t << "'"); delete q; self_destruct(); return NULL; } - else q->addr2 = addr1; /* Decode mask (NULL or empty means a exact host mask) */ if (!DecodeMask(mask, q->mask, iptype)) {