msi: Reject NULL or empty patch package parameter in MsiApplyPatch.
This commit is contained in:
parent
2b03dd373d
commit
0d8a826ef5
|
@ -315,6 +315,9 @@ static UINT MSI_ApplyPatchW(LPCWSTR szPatchPackage, LPCWSTR szProductCode, LPCWS
|
|||
static const WCHAR patcheq[] = {'P','A','T','C','H','=',0};
|
||||
static WCHAR empty[] = {0};
|
||||
|
||||
if (!szPatchPackage || !szPatchPackage[0])
|
||||
return ERROR_INVALID_PARAMETER;
|
||||
|
||||
if (!szProductCode)
|
||||
{
|
||||
r = MsiOpenDatabaseW(szPatchPackage, MSIDBOPEN_READONLY, &patch);
|
||||
|
|
|
@ -11604,6 +11604,17 @@ static void test_MsiApplyMultiplePatches(void)
|
|||
todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
|
||||
}
|
||||
|
||||
static void test_MsiApplyPatch(void)
|
||||
{
|
||||
UINT r;
|
||||
|
||||
r = MsiApplyPatch(NULL, NULL, INSTALLTYPE_DEFAULT, NULL);
|
||||
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
|
||||
|
||||
r = MsiApplyPatch("", NULL, INSTALLTYPE_DEFAULT, NULL);
|
||||
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
|
||||
}
|
||||
|
||||
START_TEST(package)
|
||||
{
|
||||
HMODULE hmsi = GetModuleHandleA("msi.dll");
|
||||
|
@ -11642,4 +11653,5 @@ START_TEST(package)
|
|||
test_MsiGetProductProperty();
|
||||
test_MsiSetProperty();
|
||||
test_MsiApplyMultiplePatches();
|
||||
test_MsiApplyPatch();
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue