From d27b8c96eb2fd8bb170618b75ea858dc6e2f8e5d Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Wed, 2 Jul 2003 04:32:38 +0000 Subject: [PATCH] Avoid accessing uninitialized variable in TASK_Create (spotted by Robert Shearman). --- loader/task.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/loader/task.c b/loader/task.c index b7d5b859108..f83600874f6 100644 --- a/loader/task.c +++ b/loader/task.c @@ -258,7 +258,6 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cm { HTASK16 hTask; TDB *pTask; - char name[10]; FARPROC16 proc; HMODULE16 hModule = pModule ? pModule->self : 0; @@ -302,8 +301,10 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cm if (hModule) { + char name[10]; GetModuleName16( hModule, name, sizeof(name) ); strncpy( pTask->module_name, name, sizeof(pTask->module_name) ); + pTask->compat_flags = GetProfileIntA( "Compatibility", name, 0 ); } /* Allocate a selector for the PDB */ @@ -345,11 +346,7 @@ static TDB *TASK_Create( NE_MODULE *pModule, UINT16 cmdShow, TEB *teb, LPCSTR cm memcpy( pTask->pdb.cmdLine + 1, cmdline, len ); /* pTask->pdb.cmdLine[len+1] = 0; */ - TRACE("module='%s' cmdline='%.*s' task=%04x\n", name, len, cmdline, hTask ); - - /* Get the compatibility flags */ - - pTask->compat_flags = GetProfileIntA( "Compatibility", name, 0 ); + TRACE("cmdline='%.*s' task=%04x\n", len, cmdline, hTask ); /* Allocate a code segment alias for the TDB */