From: bert hubert Date: Tue, 2 Sep 2014 09:55:11 +0000 (+0200) Subject: pdns_iequals fix X-Git-Tag: auth-3.4.0-rc2~24 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b10795de4c8f9cc3e665bcb2dc9f339da7e54598;p=thirdparty%2Fpdns.git pdns_iequals fix --- diff --git a/pdns/misc.hh b/pdns/misc.hh index 81291a3742..28bede0503 100644 --- a/pdns/misc.hh +++ b/pdns/misc.hh @@ -330,7 +330,8 @@ inline bool pdns_iequals(const std::string& a, const std::string& b) return false; const char *aPtr = a.c_str(), *bPtr = b.c_str(); - while(*aPtr) { + const char *aEptr = aPtr + a.length(); + while(aPtr != aEptr) { if((*aPtr != *bPtr) && (dns_tolower(*aPtr) != dns_tolower(*bPtr))) return false; aPtr++;