Author: hbelusca
Date: Wed May 3 19:57:28 2017
New Revision: 74463
URL:
http://svn.reactos.org/svn/reactos?rev=74463&view=rev
Log:
[CONSRV]: Use string-safe functions to copy the font names into the fixed-size buffers.
Modified:
trunk/reactos/win32ss/user/winsrv/consrv/consrv.h
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
Modified: trunk/reactos/win32ss/user/winsrv/consrv/consrv.h
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] (original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/consrv.h [iso-8859-1] Wed May 3 19:57:28
2017
@@ -11,6 +11,8 @@
/* Main header */
#include "../winsrv.h"
+
+#include <strsafe.h>
/* PSDK/NDK Headers */
#define WIN32_NO_STATUS
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guisettings.c [iso-8859-1] Wed
May 3 19:57:28 2017
@@ -161,8 +161,8 @@
pSharedInfo->CodePage = Console->OutputCodePage;
/* GUI Information */
- wcsncpy(pSharedInfo->FaceName, GuiData->GuiInfo.FaceName, LF_FACESIZE);
- pSharedInfo->FaceName[LF_FACESIZE - 1] = UNICODE_NULL;
+ StringCchCopyNW(pSharedInfo->FaceName, ARRAYSIZE(pSharedInfo->FaceName),
+ GuiData->GuiInfo.FaceName,
ARRAYSIZE(GuiData->GuiInfo.FaceName));
pSharedInfo->FontFamily = GuiData->GuiInfo.FontFamily;
pSharedInfo->FontSize = GuiData->GuiInfo.FontSize;
pSharedInfo->FontWeight = GuiData->GuiInfo.FontWeight;
Modified: trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c
URL:
http://svn.reactos.org/svn/reactos/trunk/reactos/win32ss/user/winsrv/consrv…
==============================================================================
--- trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1]
(original)
+++ trunk/reactos/win32ss/user/winsrv/consrv/frontends/gui/guiterm.c [iso-8859-1] Wed May
3 19:57:28 2017
@@ -1272,8 +1272,8 @@
#endif
// Font data
- wcsncpy(GuiInitInfo->TermInfo.FaceName, ConsoleInfo->FaceName, LF_FACESIZE);
- GuiInitInfo->TermInfo.FaceName[LF_FACESIZE - 1] = UNICODE_NULL;
+ StringCchCopyNW(GuiInitInfo->TermInfo.FaceName,
ARRAYSIZE(GuiInitInfo->TermInfo.FaceName),
+ ConsoleInfo->FaceName, ARRAYSIZE(ConsoleInfo->FaceName));
GuiInitInfo->TermInfo.FontFamily = ConsoleInfo->FontFamily;
GuiInitInfo->TermInfo.FontSize = ConsoleInfo->FontSize;
GuiInitInfo->TermInfo.FontWeight = ConsoleInfo->FontWeight;