msi: Avoid accessing uninitialized memory in ACTION_AppSearchReg.

Found by valgrind.
oldstable
Hans Leidekker 2009-10-27 10:07:50 +01:00 committed by Alexandre Julliard
parent 3f70b07870
commit 2eb33f5bcb
1 changed files with 2 additions and 1 deletions

View File

@ -445,7 +445,8 @@ static UINT ACTION_AppSearchReg(MSIPACKAGE *package, LPWSTR *appValue, MSISIGNAT
if (sz == 0)
goto end;
if ((ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"')))
if ((regType == REG_SZ || regType == REG_EXPAND_SZ) &&
(ptr = strchrW((LPWSTR)value, '"')) && (end = strchrW(++ptr, '"')))
*end = '\0';
else
ptr = (LPWSTR)value;