kernel32: LOADPARAMS16->showCmd can be NULL, do not crash in that case.

This commit is contained in:
Dmitry Timoshkov 2008-01-31 14:08:08 +08:00 committed by Alexandre Julliard
parent 661b01f922
commit 21204f579e
1 changed files with 3 additions and 2 deletions

View File

@ -1193,7 +1193,7 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock )
HMODULE16 hModule; HMODULE16 hModule;
NE_MODULE *pModule; NE_MODULE *pModule;
LPSTR cmdline; LPSTR cmdline;
WORD cmdShow; WORD cmdShow = 1; /* SW_SHOWNORMAL but we don't want to include winuser.h here */
if (name == NULL) return 0; if (name == NULL) return 0;
@ -1235,7 +1235,8 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock )
* information. * information.
*/ */
params = (LOADPARAMS16 *)paramBlock; params = (LOADPARAMS16 *)paramBlock;
cmdShow = ((WORD *)MapSL(params->showCmd))[1]; if (params->showCmd)
cmdShow = ((WORD *)MapSL( params->showCmd ))[1];
cmdline = MapSL( params->cmdLine ); cmdline = MapSL( params->cmdLine );
return NE_CreateThread( pModule, cmdShow, cmdline ); return NE_CreateThread( pModule, cmdShow, cmdline );
} }