1
0
Fork 0
mirror of https://github.com/gwm17/implot.git synced 2024-10-09 15:47:26 -04:00

protection against buffer overruns in BufferWriter

This commit is contained in:
SergeyN 2020-05-12 18:49:21 +02:00
parent 7d550d350e
commit ff5d61756f

View File

@ -1425,7 +1425,8 @@ class BufferWriter {
private:
void VWrite(const char* fmt, va_list argp) {
const int written = ::vsnprintf(&Buffer[Pos], Size - Pos - 1, fmt, argp);
Pos += written;
if (written > 0)
Pos += ImMin(size_t(written), Size-Pos-1);
}
char* const Buffer;