prevent buffer overflow, LoadString accepts the size of the buffer in TCHARs, not...
authorThomas Bluemel <thomas@reactsoft.com>
Wed, 4 May 2005 22:21:55 +0000 (22:21 +0000)
committerThomas Bluemel <thomas@reactsoft.com>
Wed, 4 May 2005 22:21:55 +0000 (22:21 +0000)
svn path=/trunk/; revision=14980

reactos/subsys/ntvdm/ntvdm.c

index 84e9abf..362e629 100644 (file)
@@ -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");