Author: pschweitzer
Date: Sun Apr 6 20:14:16 2014
New Revision: 62674
URL:
http://svn.reactos.org/svn/reactos?rev=62674&view=rev
Log:
[CHARMAP]
Fix buffer overruns. Dedicated to Thomas :-).
CID #515199
CID #512920
Modified:
trunk/reactos/base/applications/charmap/lrgcell.c
trunk/reactos/base/applications/charmap/map.c
Modified: trunk/reactos/base/applications/charmap/lrgcell.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/…
==============================================================================
--- trunk/reactos/base/applications/charmap/lrgcell.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/charmap/lrgcell.c [iso-8859-1] Sun Apr 6 20:14:16
2014
@@ -48,8 +48,9 @@
hdc);
lf.lfCharSet = DEFAULT_CHARSET;
- wcscpy(lf.lfFaceName,
- lpFontName);
+ wcscpy_s(lf.lfFaceName,
+ sizeof(lf.lfFaceName) / sizeof(lf.lfFaceName[0]),
+ lpFontName);
hFont = CreateFontIndirectW(&lf);
Modified: trunk/reactos/base/applications/charmap/map.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/base/applications/charmap/…
==============================================================================
--- trunk/reactos/base/applications/charmap/map.c [iso-8859-1] (original)
+++ trunk/reactos/base/applications/charmap/map.c [iso-8859-1] Sun Apr 6 20:14:16 2014
@@ -228,8 +228,9 @@
ReleaseDC(infoPtr->hMapWnd, hdc);
infoPtr->CurrentFont.lfCharSet = DEFAULT_CHARSET;
- wcscpy(infoPtr->CurrentFont.lfFaceName,
- lpFontName);
+ wcscpy_s(infoPtr->CurrentFont.lfFaceName,
+ sizeof(infoPtr->CurrentFont.lfFaceName) /
sizeof(infoPtr->CurrentFont.lfFaceName[0]),
+ lpFontName);
infoPtr->hFont = CreateFontIndirectW(&infoPtr->CurrentFont);