]> git.ipfire.org Git - thirdparty/make.git/commit
Ensure variable_buffer is always nul-terminated
authorPaul Smith <psmith@gnu.org>
Sun, 26 Mar 2023 13:24:06 +0000 (09:24 -0400)
committerPaul Smith <psmith@gnu.org>
Sun, 26 Mar 2023 13:24:06 +0000 (09:24 -0400)
commita367c0640fcbf9872cde1f8c79f4f11658807ad1
treea1789aa5c494ae11ab3aeebde5bf09b202c95776
parent3088e3e69874f4f25349e1870da5eeeb8a88e1ca
Ensure variable_buffer is always nul-terminated

* src/expand.c (variable_buffer_output): Allocate an extra byte and
set it to nul.  For safety, add assert() on PTR.
(variable_expand_string): Don't call variable_buffer_output just to
add a nul byte.
(allocated_variable_append): Ditto.
src/expand.c
src/function.c
src/variable.c