]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commit
Improve robustness of Con_CenterPrintf()
authorbones_was_here <bones_was_here@xonotic.au>
Tue, 28 May 2024 20:19:11 +0000 (06:19 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Fri, 31 May 2024 07:36:05 +0000 (17:36 +1000)
commit9acc6233eb9fb8be9faf56ebb1c796995bc41f16
tree80718ac54e8ab333f5373e666eb4cb51b51fe9d9
parent927653bfb8f3210c30da8b9552b48abb7e5569e9
Improve robustness of Con_CenterPrintf()

This code was OK, but if someone were to change the buffer size(s) such
that line[] were smaller than msg[], or were to call Con_CenterPrintf()
with a maxLineLength > 40, then a buffer overflow would have become
possible.  This patch prevents it.

See https://github.com/DarkPlacesEngine/darkplaces/pull/159

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