On Thu, Dec 18, 2008 at 2:21 PM, Andrew Talbot andrew.talbot@talbotville.com wrote:
Changelog: jscript: Do not call memcpy() with NULL pointer argument.
diff --git a/dlls/jscript/string.c b/dlls/jscript/string.c index eeceb1f..b49d3b3 100644 --- a/dlls/jscript/string.c +++ b/dlls/jscript/string.c @@ -1395,8 +1395,12 @@ HRESULT create_string(script_ctx_t *ctx, const WCHAR *str, DWORD len, DispatchEx return E_OUTOFMEMORY; }
- memcpy(string->str, str, len*sizeof(WCHAR));
- string->str[len] = 0;
if (str) {
memcpy(string->str, str, len*sizeof(WCHAR));
string->str[len] = 0;
}else {
string->str[0] = 0;
}
*ret = &string->dispex; return S_OK;
I didn't write jscript, so I'm not the expert, but create_string is internal, so we should probably crash if str is NULL instead of hiding the error. What is this patch for?