mirror of
https://github.com/libsdl-org/SDL.git
synced 2026-01-09 14:52:46 +00:00
2cb9a4fcc14121305e9a0975ded67bc67a66ae57
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.
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)
Languages
C
86.4%
C++
5.8%
Objective-C
3.4%
CMake
1.6%
Perl
0.8%
Other
1.7%