msxml3: Fix possible NULL pointer access in heap_strdupW

André Hentschel nerv at dawncrow.de
Sat Nov 17 15:52:35 CST 2012


we already do that (ieframe,vbscript,wininet,.. are good examples), but not consistent all over the place
---
 dlls/msxml3/msxml_private.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/dlls/msxml3/msxml_private.h b/dlls/msxml3/msxml_private.h
index 503a580..66baea8 100644
--- a/dlls/msxml3/msxml_private.h
+++ b/dlls/msxml3/msxml_private.h
@@ -194,7 +194,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;
-- 
1.8.0



-- 

Best Regards, André Hentschel


More information about the wine-patches mailing list