prevent buffer overflow, LoadString accepts the size of the buffer in
TCHARs, not in bytes!
Modified: trunk/reactos/subsys/system/userinit/userinit.c
_____
Modified: trunk/reactos/subsys/system/userinit/userinit.c
--- trunk/reactos/subsys/system/userinit/userinit.c 2005-05-04
22:21:55 UTC (rev 14980)
+++ trunk/reactos/subsys/system/userinit/userinit.c 2005-05-04
22:32:43 UTC (rev 14981)
@@ -105,8 +105,8 @@
}
else
{
- LoadString( GetModuleHandle(NULL), STRING_USERINIT_FAIL, (LPTSTR)
szMsg,sizeof(szMsg));
- MessageBox(0, szMsg, NULL, 0);
+ LoadString( GetModuleHandle(NULL), STRING_USERINIT_FAIL, szMsg,
sizeof(szMsg) / sizeof(szMsg[0]));
+ MessageBox(0, szMsg, NULL, 0);
}
}
Show replies by date