dwrite: Fix possible NULL pointer access in heap_strdup*.

This commit is contained in:
André Hentschel 2012-11-17 22:52:26 +01:00 committed by Alexandre Julliard
parent bafe54e7e5
commit 7e2cac2602
1 changed files with 7 additions and 3 deletions

View File

@ -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;
}