From 21204f579e508872ab6e39282bb801fb0219b65d Mon Sep 17 00:00:00 2001 From: Dmitry Timoshkov Date: Thu, 31 Jan 2008 14:08:08 +0800 Subject: [PATCH] kernel32: LOADPARAMS16->showCmd can be NULL, do not crash in that case. --- dlls/kernel32/ne_module.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/dlls/kernel32/ne_module.c b/dlls/kernel32/ne_module.c index e41ced97cdc..09e317592f0 100644 --- a/dlls/kernel32/ne_module.c +++ b/dlls/kernel32/ne_module.c @@ -1193,7 +1193,7 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock ) HMODULE16 hModule; NE_MODULE *pModule; LPSTR cmdline; - WORD cmdShow; + WORD cmdShow = 1; /* SW_SHOWNORMAL but we don't want to include winuser.h here */ if (name == NULL) return 0; @@ -1235,7 +1235,8 @@ HINSTANCE16 WINAPI LoadModule16( LPCSTR name, LPVOID paramBlock ) * information. */ params = (LOADPARAMS16 *)paramBlock; - cmdShow = ((WORD *)MapSL(params->showCmd))[1]; + if (params->showCmd) + cmdShow = ((WORD *)MapSL( params->showCmd ))[1]; cmdline = MapSL( params->cmdLine ); return NE_CreateThread( pModule, cmdShow, cmdline ); }