msi: Initialize type. If the value did not exist, type was uninitialized and passed to RegSetValueExW.

This commit is contained in:
James Hawkins 2009-12-16 19:05:27 -08:00 committed by Alexandre Julliard
parent 9b2af10f02
commit 26d541b2a9
1 changed files with 1 additions and 0 deletions

View File

@ -5008,6 +5008,7 @@ static UINT ITERATE_WriteEnvironmentString( MSIRECORD *rec, LPVOID param )
FIXME("Not removing environment variable on uninstall!\n");
size = 0;
type = REG_SZ;
res = RegQueryValueExW(env, name, NULL, &type, NULL, &size);
if ((res != ERROR_SUCCESS && res != ERROR_FILE_NOT_FOUND) ||
(res == ERROR_SUCCESS && type != REG_SZ && type != REG_EXPAND_SZ))