]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Fix heap buffer overead in ConfigParser::UnQuote() (#1763)
authorxiaoxiaoafeifei <zhailiangliang@loongson.cn>
Tue, 2 Apr 2024 07:04:31 +0000 (07:04 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 2 Apr 2024 15:50:33 +0000 (15:50 +0000)
Detected by using AddressSanitizer.

CONTRIBUTORS
src/ConfigParser.cc

index 9e4a3214c9a25ed9e600dc09b1dbc2d98a6c6287..cc104be4e858a2fb4b7e3d41fae89119ca467cf9 100644 (file)
@@ -300,6 +300,7 @@ Thank you!
     Leeann Bent <lbent@cs.ucsd.edu>
     Leonardo Taccari
     Leonid Evdokimov <leon@darkk.net.ru>
+    Liangliang Zhai <zhailiangliang@loongson.cn>
     libit <sambabug.lb@gmail.com>
     Lubos Uhliarik <luhliari@redhat.com>
     Luigi Gangitano <luigi@debian.org>
index c65124ece68ee163691c526cd225f5a78aa1a614..0e405eb85ae8386c05bf1dd6e087e17668f55805 100644 (file)
@@ -181,7 +181,7 @@ ConfigParser::UnQuote(const char *token, const char **next)
     *d = '\0';
 
     // We are expecting a separator after quoted string, space or one of "()#"
-    if (*(s + 1) != '\0' && !strchr(w_space "()#", *(s + 1)) && !errorStr) {
+    if (!errorStr && *(s + 1) != '\0' && !strchr(w_space "()#", *(s + 1))) {
         errorStr = "Expecting space after the end of quoted token";
         errorPos = token;
     }