public: crtlib: check for empty buffer in Q_vsnprintf
This commit is contained in:
parent
add02dc6f9
commit
151e7fe37b
1 changed files with 3 additions and 0 deletions
|
@ -339,6 +339,9 @@ int Q_vsnprintf( char *buffer, size_t buffersize, const char *format, va_list ar
|
||||||
{
|
{
|
||||||
int result;
|
int result;
|
||||||
|
|
||||||
|
if( unlikely( buffersize == 0 ))
|
||||||
|
return -1; // report as overflow
|
||||||
|
|
||||||
#ifndef _MSC_VER
|
#ifndef _MSC_VER
|
||||||
result = vsnprintf( buffer, buffersize, format, args );
|
result = vsnprintf( buffer, buffersize, format, args );
|
||||||
#else
|
#else
|
||||||
|
|
Loading…
Add table
Reference in a new issue