diff --git a/src/common/string.cpp b/src/common/string.cpp index 136f46f224..d2c5e8c052 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -1289,7 +1289,7 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) UngetWriteBuf(); - if ( len >= 0 ) + if ( (len >= 0) && (len <= size) ) { // ok, there was enough space break;