]> git.ipfire.org Git - thirdparty/squid.git/commit
Bug 4969: GCC-9 build failure: stringop-truncation (#441)
authorAmos Jeffries <yadij@users.noreply.github.com>
Fri, 19 Jul 2019 15:11:49 +0000 (15:11 +0000)
committerSquid Anubis <squid-anubis@squid-cache.org>
Sun, 28 Jul 2019 02:52:56 +0000 (02:52 +0000)
commit02fc37ca9112cd2afd7d9f3acea06c53b900453a
tree00523dbc7c00f90830d1b6b32ba44ab7b44d33e4
parent424f369933b372eb6a4093b13593311778ba9152
Bug 4969: GCC-9 build failure: stringop-truncation (#441)

GCC-9 with Squid use of -Werror makes these warning hard
errors which can no longer be ignored. We are thus required
to alter this third-party code when built for Squid.

Truncation of these strings is fine. Rather than suppress
GCC warnings, switch to xstrncpy() which has similar
behaviour but guarantees c-string terminator exists within
the copied range limit (removing need for two -1 hacks).

This change will add terminators on path and device_type
values in the rare case of overly long configured values.
It is not clear what ancient Domain Controllers would do
when handed un-terminated c-string in those cases, but was
unlikely to be good.
lib/smblib/smblib-util.c