added wxVaCopy() and use it to fix wxVsnprintf() crash (see bug 1017651)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@29604 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1727,7 +1727,12 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
|
||||
return -1;
|
||||
}
|
||||
|
||||
len = wxVsnprintf(buf, size, pszFormat, argptr);
|
||||
// wxVsnprintf() may modify the original arg pointer, so pass it
|
||||
// only a copy
|
||||
va_list argptrcopy;
|
||||
wxVaCopy(argptrcopy, argptr);
|
||||
len = wxVsnprintf(buf, size, pszFormat, argptrcopy);
|
||||
va_end(argptrcopy);
|
||||
|
||||
// some implementations of vsnprintf() don't NUL terminate
|
||||
// the string if there is not enough space for it so
|
||||
|
Reference in New Issue
Block a user