msi: Don't crash on null last parameter in MsiDecomposeDescriptor.

This commit is contained in:
Hans Leidekker 2010-03-23 11:48:02 +01:00 committed by Alexandre Julliard
parent d0856c0ac5
commit 367c2048a1
2 changed files with 4 additions and 1 deletions

View File

@ -1156,7 +1156,7 @@ UINT WINAPI MsiDecomposeDescriptorW( LPCWSTR szDescriptor, LPWSTR szProduct,
len = ( &p[21] - szDescriptor );
TRACE("length = %d\n", len);
*pUsed = len;
if (pUsed) *pUsed = len;
return ERROR_SUCCESS;
}

View File

@ -479,6 +479,9 @@ static void test_msidecomposedesc(void)
r = pMsiDecomposeDescriptorA(NULL, NULL, NULL, NULL, &len);
ok(r == ERROR_INVALID_PARAMETER, "returned wrong error\n");
ok(len == 0, "length wrong\n");
r = pMsiDecomposeDescriptorA(desc, NULL, NULL, NULL, NULL);
ok(r == ERROR_SUCCESS, "returned wrong error\n");
}
static UINT try_query_param( MSIHANDLE hdb, LPCSTR szQuery, MSIHANDLE hrec )