mirror of
https://github.com/Mauler125/r5sdk.git
synced 2025-02-09 19:15:03 +01:00
SDL: fix buffer overrun in SDL_strncmp
Always check len first before dereferencing the pointers.
This commit is contained in:
parent
d9432129b2
commit
c0832b91d3
2
src/thirdparty/sdl/src/stdlib/SDL_string.c
vendored
2
src/thirdparty/sdl/src/stdlib/SDL_string.c
vendored
@ -1086,7 +1086,7 @@ SDL_strncmp(const char *str1, const char *str2, size_t maxlen)
|
||||
#if defined(HAVE_STRNCMP)
|
||||
return strncmp(str1, str2, maxlen);
|
||||
#else
|
||||
while (*str1 && *str2 && maxlen) {
|
||||
while (maxlen && *str1 && *str2) {
|
||||
if (*str1 != *str2)
|
||||
break;
|
||||
++str1;
|
||||
|
Loading…
x
Reference in New Issue
Block a user