Michael Stefaniuc : dmloader: Avoid a crash on a NULL string pointer.

Alexandre Julliard julliard at winehq.org
Thu Apr 27 15:49:11 CDT 2017


Module: wine
Branch: master
Commit: ed6ee0f815518a7bbb3942dbc49f157a57970db1
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=ed6ee0f815518a7bbb3942dbc49f157a57970db1

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Thu Apr 27 19:15:27 2017 +0200

dmloader: Avoid a crash on a NULL string pointer.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/dmloader/loader.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index 0822891..d644abb 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -536,12 +536,16 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_ScanDirectory(IDirectMusicLoader8 *
 	WCHAR wszSearchString[MAX_PATH];
 	WCHAR *p;
 	HRESULT result;
-	TRACE("(%p, %s, %p, %p)\n", This, debugstr_dmguid(rguidClass), pwzFileExtension, pwzScanFileName);
+        TRACE("(%p, %s, %s, %s)\n", This, debugstr_dmguid(rguidClass), debugstr_w(pwzFileExtension),
+                        debugstr_w(pwzScanFileName));
 	if (IsEqualGUID (rguidClass, &GUID_DirectMusicAllTypes) || !DMUSIC_IsValidLoadableClass(rguidClass)) {
 		ERR(": rguidClass invalid CLSID\n");
 		return REGDB_E_CLASSNOTREG;
 	}
-	
+
+        if (!pwzFileExtension)
+                return S_FALSE;
+
 	/* get search path for given class */
 	DMUSIC_GetLoaderSettings (iface, rguidClass, wszSearchString, NULL);
 	




More information about the wine-cvs mailing list