]> git.saurik.com Git - wxWidgets.git/commitdiff
Fix potential buffer overflow in wxSTC DefaultFont() function.
authorVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Jul 2013 00:28:13 +0000 (00:28 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Sat, 6 Jul 2013 00:28:13 +0000 (00:28 +0000)
Use safe(r) wxStrlcpy() instead of strcpy() to copy the font name.

Closes #15296.

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@74405 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/stc/PlatWX.cpp

index a11ddd82bc6c222e0de57224b183887970dfb3a2..b752c39689a1331b517639426cf15e6cc8e207cb 100644 (file)
@@ -1410,7 +1410,7 @@ ColourDesired Platform::ChromeHighlight() {
 
 const char *Platform::DefaultFont() {
     static char buf[128];
-    strcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str());
+    wxStrlcpy(buf, wxNORMAL_FONT->GetFaceName().mbc_str(), WXSIZEOF(buf));
     return buf;
 }