]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 4875 pt1: GCC-8 compile errors with -O3 optimization (#287) M-staged-PR287
authorAmos Jeffries <yadij@users.noreply.github.com>
Tue, 18 Sep 2018 17:43:59 +0000 (17:43 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Tue, 18 Sep 2018 17:44:04 +0000 (17:44 +0000)
commit09863fb75c3af7dee3aab5271a37eea10c474604
tree54e82d6fc9b86a2095ca23033a5cf74ec5182e74
parent0aaca7830e49325b722f04f493a2089059deaa7f
Bug 4875 pt1: GCC-8 compile errors with -O3 optimization (#287)

 Use xstrncpy instead of strncat for String appending

Our xstrncpy() is safer, not assuming the existing char*
is nul-terminated and accounting explicitly for the
nul-terminator byte.

GCC-8 -O3 optimizations were exposing a strncat() output
truncation of the terminator when insufficient space was
available in the String buffer.
src/String.cc