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:
1 parent
d5032582e0
commit
dc4c7d9539
2 files changed
+8
-1
No files matched your search
@@ -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