Commit 7e2cac26 authored by André Hentschel's avatar André Hentschel Committed by Alexandre Julliard

dwrite: Fix possible NULL pointer access in heap_strdup*.

parent bafe54e7
......@@ -47,7 +47,8 @@ static inline LPWSTR heap_strdupW(const WCHAR *str)
size = (strlenW(str)+1)*sizeof(WCHAR);
ret = heap_alloc(size);
memcpy(ret, str, size);
if(ret)
memcpy(ret, str, size);
}
return ret;
......@@ -60,8 +61,11 @@ static inline LPWSTR heap_strdupnW(const WCHAR *str, UINT32 len)
if (len)
{
ret = heap_alloc((len+1)*sizeof(WCHAR));
memcpy(ret, str, len*sizeof(WCHAR));
ret[len] = 0;
if(ret)
{
memcpy(ret, str, len*sizeof(WCHAR));
ret[len] = 0;
}
}
return ret;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment