MSDN says RegQueryValueEx might not always return null terminated strings
git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@4115 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
parent
f189322a12
commit
3eb2576adb
1 changed files with 6 additions and 2 deletions
|
@ -1198,7 +1198,7 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
p[0]=0;
|
p[0]=0;
|
||||||
if (hKey)
|
if (hKey)
|
||||||
{
|
{
|
||||||
DWORD l = NSIS_MAX_STRLEN;
|
DWORD l = NSIS_MAX_STRLEN - 1;
|
||||||
DWORD t;
|
DWORD t;
|
||||||
|
|
||||||
if (RegQueryValueEx(hKey,buf3,NULL,&t,p,&l) != ERROR_SUCCESS ||
|
if (RegQueryValueEx(hKey,buf3,NULL,&t,p,&l) != ERROR_SUCCESS ||
|
||||||
|
@ -1214,7 +1214,11 @@ static int NSISCALL ExecuteEntry(entry *entry_)
|
||||||
if (!parm4) exec_error++;
|
if (!parm4) exec_error++;
|
||||||
myitoa(p,*((DWORD*)p));
|
myitoa(p,*((DWORD*)p));
|
||||||
}
|
}
|
||||||
else if (parm4) exec_error++;
|
else
|
||||||
|
{
|
||||||
|
if (parm4) exec_error++;
|
||||||
|
p[l]=0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
RegCloseKey(hKey);
|
RegCloseKey(hKey);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue