[perl #48367] [BUG] intlist_get could be dereferencing NULL

2008-07-27 Thread Christoph Otto via RT
On Sat Jul 26 14:34:26 2008, [EMAIL PROTECTED] wrote: I'd write that as: if (ret) return *(INTVAL *)ret; return (INTVAL)0; The pointer casting dereferencing bothers me a little, but if compilers don't warn about it -- c That looks cleaner. I made

Re: [perl #48367] [BUG] intlist_get could be dereferencing NULL

2008-07-26 Thread chromatic
On Friday 25 July 2008 01:12:55 Christoph Otto via RT wrote: According to make cover, the case where the return was -1 was never hit.  A simple test case caused a segfault, which definitely isn't the right thing.  The attached patch fixes and refactors intlist_get() to make the coverage more

[perl #48367] [BUG] intlist_get could be dereferencing NULL

2008-07-25 Thread Christoph Otto via RT
On Sat Dec 08 18:24:17 2007, petdance wrote: In intlist_get(), we call list_get() which can return a NULL. Then, the result is checked against -1, and then dereferenced. I suspect that check against -1 should actually be a check against NULL, but don't know enough to prove it and