mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-08 20:38:14 +00:00
Fixed infinite loop in SDL_vsnprintf() if the format string is too large for the output buffer
Fixes https://github.com/libsdl-org/SDL/issues/4940
This commit is contained in:
@@ -1887,8 +1887,9 @@ SDL_vsnprintf(SDL_OUT_Z_CAP(maxlen) char *text, size_t maxlen, const char *fmt,
|
||||
}
|
||||
} else {
|
||||
if (length < maxlen) {
|
||||
text[length] = *fmt++;
|
||||
text[length] = *fmt;
|
||||
}
|
||||
++fmt;
|
||||
++length;
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user