[PATCH 1/4] dmloader: Avoid a crash on a NULL string pointer.

Michael Stefaniuc mstefani at winehq.org
Thu Apr 27 12:15:27 CDT 2017


Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
Prevents a crash in Bjorn Lynne's dmdemo1.zip.


 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);
 	
-- 
2.9.3




More information about the wine-patches mailing list