[msi] Correct returnvalue for NULL input (Coverity)

Paul Vriens Paul.Vriens at xs4all.nl
Tue Sep 19 12:59:56 CDT 2006


Hi,

as we are already checking if szPackagePath is not NULL, I didn't see any harm
in adding the proper returnvalue if it is NULL. (With simple test).

Fixed CID-199.

Changelog
  Correct returnvalue for NULL input

Cheers,

Paul.
---
 dlls/msi/msi.c           |    2 ++
 dlls/msi/tests/install.c |    3 +++
 2 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c
index d15f222..baf5720 100644
--- a/dlls/msi/msi.c
+++ b/dlls/msi/msi.c
@@ -178,6 +178,8 @@ UINT WINAPI MsiInstallProductA(LPCSTR sz
         if( !szwPath )
             goto end;
     }
+    else
+        return ERROR_INVALID_PARAMETER;
 
     if( szCommandLine )
     {
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 33f34b3..98fe2f2 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -603,6 +603,9 @@ static void test_MsiInstallProduct(void)
     HKEY hkey;
     DWORD num, size, type;
 
+    r = MsiInstallProductA(NULL, NULL);
+    ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
+
     r = MsiInstallProductA(msifile, NULL);
     todo_wine
     {
-- 
1.4.2.1




More information about the wine-patches mailing list