From c1b7289bd6cbe29a42fd7d7262f469471a199932 Mon Sep 17 00:00:00 2001 From: Thomas Bluemel Date: Wed, 4 May 2005 22:21:55 +0000 Subject: [PATCH] prevent buffer overflow, LoadString accepts the size of the buffer in TCHARs, not in bytes! svn path=/trunk/; revision=14980 --- reactos/subsys/ntvdm/ntvdm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/reactos/subsys/ntvdm/ntvdm.c b/reactos/subsys/ntvdm/ntvdm.c index 84e9abf0802..362e629585c 100644 --- a/reactos/subsys/ntvdm/ntvdm.c +++ b/reactos/subsys/ntvdm/ntvdm.c @@ -280,8 +280,8 @@ WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPSTR lpCmdLine, int nSho WCHAR PromptMsg[RC_STRING_MAX_SIZE]; CHAR InputBuffer[255]; - LoadString( GetModuleHandle(NULL), STRING_WelcomeMsg, (LPTSTR) WelcomeMsg,sizeof(WelcomeMsg)); - LoadString( GetModuleHandle(NULL), STRING_PromptMsg, (LPTSTR) PromptMsg ,sizeof(PromptMsg)); + LoadString( GetModuleHandle(NULL), STRING_WelcomeMsg, (LPTSTR) WelcomeMsg,sizeof(WelcomeMsg) / sizeof(WelcomeMsg[0])); + LoadString( GetModuleHandle(NULL), STRING_PromptMsg, (LPTSTR) PromptMsg ,sizeof(PromptMsg) / sizeof(PromptMsg[0])); AllocConsole(); SetConsoleTitleW(L"ntvdm");