]> 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)
committerAmos Jeffries <yadij@users.noreply.github.com>
Sat, 3 Aug 2019 06:34:33 +0000 (18:34 +1200)
commit50737433ede5f04dff91b714b2503536fe9c9912
treef261494dbbc4fd81ee5dc38807f3634376e1736d
parent81c87ade64ea98d2daf35e1a2bd5aa7e0ff4c539
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