Module: wine Branch: stable Commit: 863a496cef8066623b43cc8b135daf0846145944 URL: http://source.winehq.org/git/wine.git/?a=commit;h=863a496cef8066623b43cc8b13...
Author: Michael Stefaniuc mstefani@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@winehq.org Signed-off-by: Alexandre Julliard julliard@winehq.org (cherry picked from commit ed6ee0f815518a7bbb3942dbc49f157a57970db1) Signed-off-by: Michael Stefaniuc mstefani@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);