Michael Stefaniuc : dmloader: Handle NULL and empty path strings in SetSearchDirectory().
Alexandre Julliard
julliard at winehq.org
Tue Jul 25 16:11:27 CDT 2017
Module: wine
Branch: master
Commit: 2e3a8a6fb8e0dfc58f84f1f10445387f9153f44a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=2e3a8a6fb8e0dfc58f84f1f10445387f9153f44a
Author: Michael Stefaniuc <mstefani at winehq.org>
Date: Tue Jul 25 20:57:18 2017 +0200
dmloader: Handle NULL and empty path strings in SetSearchDirectory().
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/dmloader/loader.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/dlls/dmloader/loader.c b/dlls/dmloader/loader.c
index aa5dfed..6d58d43 100644
--- a/dlls/dmloader/loader.c
+++ b/dlls/dmloader/loader.c
@@ -522,9 +522,14 @@ static HRESULT WINAPI IDirectMusicLoaderImpl_SetSearchDirectory(IDirectMusicLoad
TRACE("(%p, %s, %s, %d)\n", This, debugstr_dmguid(class), debugstr_w(path), clear);
- attr = GetFileAttributesW(path);
- if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
- return DMUS_E_LOADER_BADPATH;
+ if (!path)
+ return E_POINTER;
+
+ if (path[0]) {
+ attr = GetFileAttributesW(path);
+ if (attr == INVALID_FILE_ATTRIBUTES || !(attr & FILE_ATTRIBUTE_DIRECTORY))
+ return DMUS_E_LOADER_BADPATH;
+ }
if (clear)
FIXME("clear flag ignored\n");
More information about the wine-cvs
mailing list