=?UTF-8?Q?Andr=C3=A9=20Hentschel=20?=: jscript: Fix possible NULL pointer access in heap_strdupW.

Alexandre Julliard julliard at winehq.org
Mon Nov 19 13:38:39 CST 2012


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

Author: André Hentschel <nerv at dawncrow.de>
Date:   Sat Nov 17 22:52:29 2012 +0100

jscript: Fix possible NULL pointer access in heap_strdupW.

---

 dlls/jscript/jscript.h |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/dlls/jscript/jscript.h b/dlls/jscript/jscript.h
index 6b7c5a1..0ab2e06 100644
--- a/dlls/jscript/jscript.h
+++ b/dlls/jscript/jscript.h
@@ -84,7 +84,8 @@ static inline LPWSTR heap_strdupW(LPCWSTR str)
 
         size = (strlenW(str)+1)*sizeof(WCHAR);
         ret = heap_alloc(size);
-        memcpy(ret, str, size);
+        if(ret)
+            memcpy(ret, str, size);
     }
 
     return ret;




More information about the wine-cvs mailing list