From: Alex Rousskov Date: Tue, 12 Apr 2016 06:04:23 +0000 (+1200) Subject: Bug 4468: NotNode (!acl) naming: Terminate the name before strncat(name). X-Git-Tag: SQUID_3_5_17~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d7eda62e5e17dfd42526f91b341fb209838760a2;p=thirdparty%2Fsquid.git Bug 4468: NotNode (!acl) naming: Terminate the name before strncat(name). The fix may reduce or even eliminate garbage in logged ACL names (at least). The bug was exposed by valgrind's "Conditional jump or move depends on uninitialised value(s)" error. --- diff --git a/src/acl/BoolOps.cc b/src/acl/BoolOps.cc index 94f8cffb71..ed2396ea78 100644 --- a/src/acl/BoolOps.cc +++ b/src/acl/BoolOps.cc @@ -17,6 +17,7 @@ Acl::NotNode::NotNode(ACL *acl) { assert(acl); name[0] = '!'; + name[1] = '\0'; strncat(&name[1], acl->name, sizeof(name)-1-1); add(acl); }