Go to file
Eddy Jansson df145a9649 log: Fix unlikely out-of-bounds issue.
In the unlikely case that the overflow check should fail,
the else clause would switch to the truncated stack message
without updating the len variable. This would contain the
return value from vsnprintf(), meaning it could point beyond
the buffer.

The subsequent code which trims NL and CR from the buffer,
would then read -- and possibly write -- out-of-bounds.

To fix this, we split the two joint conditions into separate
if-clauses, and adjust the len variable in the case where we
know the message buffer was truncated.

(cherry picked from commit 2cb9a4fcc1)
2025-12-04 13:20:34 -08:00
2025-10-22 19:01:17 +02:00
2024-10-30 00:04:17 +01:00
2025-01-13 16:42:50 -08:00
2025-01-13 16:42:50 -08:00
2025-03-06 16:26:15 -08:00
2025-01-01 07:45:52 -08:00

Simple DirectMedia Layer (SDL for short) is a cross-platform library designed to make it easy to write multi-media software, such as games and emulators.

You can find the latest release and additional information at: https://www.libsdl.org/

Installation instructions and a quick introduction is available in INSTALL.md

This library is distributed under the terms of the zlib license, available in LICENSE.txt.

Enjoy!

Sam Lantinga (slouken@libsdl.org)

Description
Simple Directmedia Layer
Readme 162 MiB
Languages
C 86.4%
C++ 5.8%
Objective-C 3.4%
CMake 1.6%
Perl 0.8%
Other 1.7%