dwrite: Fix possible NULL pointer access in heap_strdup*.
This commit is contained in:
parent
bafe54e7e5
commit
7e2cac2602
|
@ -47,6 +47,7 @@ static inline LPWSTR heap_strdupW(const WCHAR *str)
|
|||
|
||||
size = (strlenW(str)+1)*sizeof(WCHAR);
|
||||
ret = heap_alloc(size);
|
||||
if(ret)
|
||||
memcpy(ret, str, size);
|
||||
}
|
||||
|
||||
|
@ -60,9 +61,12 @@ static inline LPWSTR heap_strdupnW(const WCHAR *str, UINT32 len)
|
|||
if (len)
|
||||
{
|
||||
ret = heap_alloc((len+1)*sizeof(WCHAR));
|
||||
if(ret)
|
||||
{
|
||||
memcpy(ret, str, len*sizeof(WCHAR));
|
||||
ret[len] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue