]> git.ipfire.org Git - thirdparty/haproxy.git/commit
BUG/MINOR: lua: remove incorrect usage of strncat()
authorWilly Tarreau <w@1wt.eu>
Fri, 7 Apr 2023 13:27:55 +0000 (15:27 +0200)
committerWilly Tarreau <w@1wt.eu>
Fri, 7 Apr 2023 14:04:54 +0000 (16:04 +0200)
commit22450af22aa112a4bcba1014db8d654208e72121
treea82578c3d241b729551054b70b64633a19ad1200
parentead43fe4f2a3c94302b042556a992be2af66194f
BUG/MINOR: lua: remove incorrect usage of strncat()

As every time strncat() is used, it's wrong, and this one is no exception.
Users often think that the length applies to the destination except it
applies to the source and makes it hard to use correctly. The bug did not
have an impact because the length was preallocated from the sum of all
the individual lengths as measured by strlen() so there was no chance one
of them would change in between. But it could change in the future. Let's
fix it to use memcpy() instead for strings, or byte copies for delimiters.

No backport is needed, though it can be done if it helps to apply other
fixes.
src/hlua.c