SysReAllocStringLen is documented to segfault on NULL pointer.

This commit is contained in:
Dimitrie O. Paun 2003-11-26 03:35:16 +00:00 committed by Alexandre Julliard
parent d8aa853596
commit 99bf92e338
1 changed files with 0 additions and 6 deletions

View File

@ -293,12 +293,6 @@ BSTR WINAPI SysAllocStringLen(const OLECHAR *str, unsigned int len)
*/ */
int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len) int WINAPI SysReAllocStringLen(BSTR* old, const OLECHAR* str, unsigned int len)
{ {
/*
* Sanity check
*/
if (old==NULL)
return 0;
if (*old!=NULL) { if (*old!=NULL) {
DWORD newbytelen = len*sizeof(WCHAR); DWORD newbytelen = len*sizeof(WCHAR);
DWORD *ptr = HeapReAlloc(GetProcessHeap(),0,((DWORD*)*old)-1,newbytelen+sizeof(WCHAR)+sizeof(DWORD)); DWORD *ptr = HeapReAlloc(GetProcessHeap(),0,((DWORD*)*old)-1,newbytelen+sizeof(WCHAR)+sizeof(DWORD));