[PATCH 11/16] [Msi]: find_given_source
Eric Pouech
eric.pouech at wanadoo.fr
Sun Oct 22 14:48:38 CDT 2006
- fixed the key enumeration
(spotted by valgrind)
A+
---
dlls/msi/source.c | 17 +++++++++--------
1 files changed, 9 insertions(+), 8 deletions(-)
diff --git a/dlls/msi/source.c b/dlls/msi/source.c
index f10c32f..e4d4a90 100644
--- a/dlls/msi/source.c
+++ b/dlls/msi/source.c
@@ -131,17 +131,18 @@ static UINT find_given_source(HKEY key,
if (rc != ERROR_NO_MORE_ITEMS)
{
val = msi_alloc(val_size);
- RegEnumValueW(key, index, szIndex, &size, NULL, NULL, (LPBYTE)val,
- &val_size);
- if (lstrcmpiW(szSource,val)==0)
+ size = sizeof(szIndex)/sizeof(szIndex[0]);
+ rc = RegEnumValueW(key, index, szIndex, &size, NULL, NULL, (LPBYTE)val,
+ &val_size);
+ if (rc == ERROR_SUCCESS)
{
- ss->path = val;
strcpyW(ss->szIndex,szIndex);
- break;
+ if (lstrcmpiW(szSource,val)==0)
+ {
+ ss->path = val;
+ break;
+ }
}
- else
- strcpyW(ss->szIndex,szIndex);
-
msi_free(val);
index ++;
}
More information about the wine-patches
mailing list