From: Vadim Zeitlin Date: Tue, 24 Nov 2009 00:02:21 +0000 (+0000) Subject: Don't use unsafe strcpy() when parsing wxNativeFontInfo. X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/3515776ea5638d93b85c871667a77f9d1ed44f6c Don't use unsafe strcpy() when parsing wxNativeFontInfo. Fix a nice buffer overflow waiting to happen due to the use of wxStrcpy(). Call wxNativeFontInfo::SetFaceName() which uses wxStrlcpy() instead. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@62709 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/msw/font.cpp b/src/msw/font.cpp index fde6b86faf..ac1a4d3cce 100644 --- a/src/msw/font.cpp +++ b/src/msw/font.cpp @@ -770,7 +770,7 @@ bool wxNativeFontInfo::FromString(const wxString& s) return false; // the face name may be empty - wxStrcpy(lf.lfFaceName, tokenizer.GetNextToken()); + SetFaceName(tokenizer.GetNextToken()); return true; }