Re: jscript: Do not call memcpy() with a NULL pointer argument

2008-12-20 Thread Andrew Talbot
Jacek Caban wrote: > I'm not fan of such fixes, but if you want to fix it, you should check > len, not str, in your patch and you may move zero-terminating outside > if..else statement. > > > Jacek Thank you, I shall fix it in the better way that you describe here. -- Andy.

Re: jscript: Do not call memcpy() with a NULL pointer argument

2008-12-20 Thread Jacek Caban
Hi Andrew, Andrew Talbot wrote: > Jacek Caban wrote: > > >> The string was always zero-terminated without your patch. It's fine to >> call create_string with NULL str argument as long as len is 0 and >> current implementation works fine in this case. >> >> >> Jacek >> > > Hi Jacek, > > Tec

Re: jscript: Do not call memcpy() with a NULL pointer argument

2008-12-19 Thread Andrew Talbot
Jacek Caban wrote: > The string was always zero-terminated without your patch. It's fine to > call create_string with NULL str argument as long as len is 0 and > current implementation works fine in this case. > > > Jacek Hi Jacek, Technically, behavior is undefined if the pointers do not each

Re: jscript: Do not call memcpy() with a NULL pointer argument

2008-12-19 Thread Jacek Caban
Andrew Talbot wrote: > On Thu Dec 18 22:41 , 'James Hawkins' sent: > > >> 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? >> >> -- >> James Hawkins >> > > H

Re: jscript: Do not call memcpy() with a NULL pointer argument

2008-12-19 Thread Andrew Talbot
On Thu Dec 18 22:41 , 'James Hawkins' sent: >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? > >-- >James Hawkins Hi James, create_string() is called on line 1323

Re: jscript: Do not call memcpy() with a NULL pointer argument

2008-12-18 Thread James Hawkins
On Thu, Dec 18, 2008 at 2:21 PM, Andrew Talbot 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