]> git.xonotic.org Git - xonotic/darkplaces.git/commit
Fix uses of strlcpy on unterminated source strings
authorbones_was_here <bones_was_here@xonotic.au>
Mon, 18 Dec 2023 09:24:15 +0000 (19:24 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 21 Jan 2024 07:00:44 +0000 (17:00 +1000)
commit3727057b879ccfeaa434537f41a302f047e8cfae
treec22d26103fc5ceb953f3064a78a6557db5baac8c
parentb60133483aa561097865246a9f94b1e51798ce10
Fix uses of strlcpy on unterminated source strings

BSD strlcpy() keeps reading until a \0 or a segfault, even after it
stops writing. In these cases the source was part of a longer string so
it wouldn't have crashed.
These were caught by the new warning.

The +1 on the source sizes copied an extra char that would be changed to
\0 and is now redundant because the real dest and src sizes are always
passed to a purpose-written func.

Signed-off-by: bones_was_here <bones_was_here@xonotic.au>
cmd.c
cmd.h
console.c
fs.c