Skip to content
Snippets Groups Projects
Commit 13ae2f5b authored by Francois Jacques's avatar Francois Jacques Committed by Alexandre Julliard
Browse files

Prevent SysAllocString and SysAllocString16 to perform any processing

on NULL strings.
parent 5c13c218
No related branches found
No related tags found
No related merge requests found
......@@ -50,7 +50,11 @@ static void* BSTR_GetAddr(BSTR16 in)
*/
BSTR16 WINAPI SysAllocString16(LPCOLESTR16 in)
{
BSTR16 out=BSTR_AllocBytes(strlen(in)+1);
BSTR16 out;
if (!in) return 0;
out = BSTR_AllocBytes(strlen(in)+1);
if(!out)return 0;
strcpy(BSTR_GetAddr(out),in);
return out;
......@@ -61,6 +65,8 @@ BSTR16 WINAPI SysAllocString16(LPCOLESTR16 in)
*/
BSTR WINAPI SysAllocString(LPCOLESTR in)
{
if (!in) return 0;
/* Delegate this to the SysAllocStringLen32 method. */
return SysAllocStringLen(in, lstrlenW(in));
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment