glibc's vswprintf doesn't nul terminate on truncation.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@40901 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -1470,6 +1470,10 @@ int wxSnprintf( wxChar *str, size_t size, const wxChar *format, ... )
|
|||||||
|
|
||||||
int ret = vswprintf( str, size, wxFormatConverter(format), argptr );
|
int ret = vswprintf( str, size, wxFormatConverter(format), argptr );
|
||||||
|
|
||||||
|
// VsnprintfTestCase reveals that glibc's implementation of vswprintf
|
||||||
|
// doesn't nul terminate on truncation.
|
||||||
|
str[size - 1] = 0;
|
||||||
|
|
||||||
va_end(argptr);
|
va_end(argptr);
|
||||||
|
|
||||||
return ret;
|
return ret;
|
||||||
|
Reference in New Issue
Block a user