From e10028893472cbc63489515222b5d7d67d505c74 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Sun, 25 Nov 2007 17:58:57 -0600 Subject: [PATCH] msi: Verify the szFilePath parameter of MsiGetFileHash. --- dlls/msi/msi.c | 6 ++++++ dlls/msi/tests/msi.c | 10 ++-------- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/dlls/msi/msi.c b/dlls/msi/msi.c index 7faccaf3afd..72e52afa87b 100644 --- a/dlls/msi/msi.c +++ b/dlls/msi/msi.c @@ -2277,6 +2277,12 @@ UINT WINAPI MsiGetFileHashW( LPCWSTR szFilePath, DWORD dwOptions, TRACE("%s %08x %p\n", debugstr_w(szFilePath), dwOptions, pHash ); + if (!szFilePath) + return ERROR_INVALID_PARAMETER; + + if (!*szFilePath) + return ERROR_PATH_NOT_FOUND; + if (dwOptions) return ERROR_INVALID_PARAMETER; if (!pHash) diff --git a/dlls/msi/tests/msi.c b/dlls/msi/tests/msi.c index 40de221f226..2e5dc85ec46 100644 --- a/dlls/msi/tests/msi.c +++ b/dlls/msi/tests/msi.c @@ -287,17 +287,11 @@ static void test_MsiGetFileHash(void) /* szFilePath is NULL */ r = pMsiGetFileHashA(NULL, 0, &hash); - 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); /* szFilePath is empty */ r = pMsiGetFileHashA("", 0, &hash); - todo_wine - { - ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %d\n", r); - } + ok(r == ERROR_PATH_NOT_FOUND, "Expected ERROR_PATH_NOT_FOUND, got %d\n", r); /* szFilePath is nonexistent */ r = pMsiGetFileHashA(name, 0, &hash);