James Hawkins : msi: Validate the parameters of MsiEnumClients.
Alexandre Julliard
julliard at winehq.org
Mon Dec 17 06:41:48 CST 2007
Module: wine
Branch: master
Commit: 5f7b95daddd3984680595ae718c1930f75556354
URL: http://source.winehq.org/git/wine.git/?a=commit;h=5f7b95daddd3984680595ae718c1930f75556354
Author: James Hawkins <truiken at gmail.com>
Date: Sun Dec 16 20:27:22 2007 -0600
msi: Validate the parameters of MsiEnumClients.
---
dlls/msi/registry.c | 5 ++++-
dlls/msi/tests/msi.c | 10 ++--------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c
index 1bee58d..daa01e3 100644
--- a/dlls/msi/registry.c
+++ b/dlls/msi/registry.c
@@ -1284,6 +1284,9 @@ UINT WINAPI MsiEnumClientsA(LPCSTR szComponent, DWORD index, LPSTR szProduct)
TRACE("%s %d %p\n", debugstr_a(szComponent), index, szProduct);
+ if ( !szProduct )
+ return ERROR_INVALID_PARAMETER;
+
if( szComponent )
{
szwComponent = strdupAtoW( szComponent );
@@ -1311,7 +1314,7 @@ UINT WINAPI MsiEnumClientsW(LPCWSTR szComponent, DWORD index, LPWSTR szProduct)
TRACE("%s %d %p\n", debugstr_w(szComponent), index, szProduct);
- if (!szComponent || !szProduct)
+ if (!szComponent || !*szComponent || !szProduct)
return ERROR_INVALID_PARAMETER;
r = MSIREG_OpenComponentsKey(szComponent,&hkeyComp,FALSE);
diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c
index e987884..61c7ddf 100644
--- a/dlls/msi/tests/msi.c
+++ b/dlls/msi/tests/msi.c
@@ -1618,18 +1618,12 @@ static void test_MsiEnumClients(void)
/* empty szComponent */
product[0] = '\0';
r = MsiEnumClientsA("", 0, product);
- todo_wine
- {
- ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- }
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
ok(!lstrcmpA(product, ""), "Expected product to be unchanged, got %s\n", product);
/* NULL lpProductBuf */
r = MsiEnumClientsA(component, 0, NULL);
- todo_wine
- {
- ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
- }
+ ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %d\n", r);
/* all params correct, component missing */
product[0] = '\0';
More information about the wine-cvs
mailing list