Skip to content

Commit

Permalink
public: crtlib: check for empty buffer in Q_vsnprintf
Browse files Browse the repository at this point in the history
  • Loading branch information
a1batross committed Feb 6, 2025
1 parent add02dc commit 151e7fe
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions public/crtlib.c
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,9 @@ int Q_vsnprintf( char *buffer, size_t buffersize, const char *format, va_list ar
{
int result;

if( unlikely( buffersize == 0 ))
return -1; // report as overflow

#ifndef _MSC_VER
result = vsnprintf( buffer, buffersize, format, args );
#else
Expand Down

0 comments on commit 151e7fe

Please sign in to comment.