Hans Leidekker : msi: Don' t crash on null last parameter in MsiDecomposeDescriptor.
Module: wine Branch: master Commit: 367c2048a19a1f5e19bc6166f98b6c95f8215da9 URL: http://source.winehq.org/git/wine.git/?a=commit;h=367c2048a19a1f5e19bc6166f9... Author: Hans Leidekker <hans(a)codeweavers.com> Date: Tue Mar 23 11:48:02 2010 +0100 msi: Don't crash on null last parameter in MsiDecomposeDescriptor. --- dlls/msi/registry.c | 2 +- dlls/msi/tests/db.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletions(-) diff --git a/dlls/msi/registry.c b/dlls/msi/registry.c index 1cbdcc9..e0a50a3 100644 --- a/dlls/msi/registry.c +++ b/dlls/msi/registry.c @@ -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; } diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 8df17e8..5571a71 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -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 )
participants (1)
-
Alexandre Julliard