mirror of
https://github.com/gwm17/implot.git
synced 2024-11-13 22:48:50 -05:00
protection against buffer overruns in BufferWriter
This commit is contained in:
parent
7d550d350e
commit
ff5d61756f
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user