Alexandre Julliard : kernel32: Fix handling of NULL argument in SetDllDirectoryA().

Alexandre Julliard julliard at winehq.org
Tue Feb 5 16:01:34 CST 2019


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Feb  5 21:46:29 2019 +0100

kernel32: Fix handling of NULL argument in SetDllDirectoryA().

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

---

 dlls/kernel32/module.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/dlls/kernel32/module.c b/dlls/kernel32/module.c
index 1199eff..3419898 100644
--- a/dlls/kernel32/module.c
+++ b/dlls/kernel32/module.c
@@ -129,10 +129,10 @@ DWORD WINAPI GetDllDirectoryW( DWORD buf_len, LPWSTR buffer )
  */
 BOOL WINAPI SetDllDirectoryA( LPCSTR dir )
 {
-    WCHAR *dirW;
+    WCHAR *dirW = NULL;
     BOOL ret;
 
-    if (!(dirW = FILE_name_AtoW( dir, TRUE ))) return FALSE;
+    if (dir && !(dirW = FILE_name_AtoW( dir, TRUE ))) return FALSE;
     ret = SetDllDirectoryW( dirW );
     HeapFree( GetProcessHeap(), 0, dirW );
     return ret;




More information about the wine-cvs mailing list