From: Alex Rousskov Date: Thu, 7 Apr 2016 00:08:06 +0000 (-0600) Subject: Fixed NotNode (!acl) naming: Terminate the name before strncat(name). X-Git-Tag: SQUID_4_0_9~22 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=428cf7bcd3cefb5b7d00ce77a8dbfe7ec2d04894;p=thirdparty%2Fsquid.git Fixed 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); }