Re: [PHP-DEV] Memory corruption bug

2009-06-28 Thread Pierre Joye
2009/6/28 Andrei Zmievski : > Pierre Joye wrote: >> >> committed. > > I see that it's not in HEAD though, probably because HEAD has never been > updated to use safe-allocation functions? I see no trace of __zend_calloc() > there. We should probably port that from 5.3. Yes, noticed that too while c

Re: [PHP-DEV] Memory corruption bug

2009-06-28 Thread Andrei Zmievski
Pierre Joye wrote: committed. I see that it's not in HEAD though, probably because HEAD has never been updated to use safe-allocation functions? I see no trace of __zend_calloc() there. We should probably port that from 5.3. -Andrei -- PHP Internals - PHP Runtime Development Mailing List T

Re: [PHP-DEV] Memory corruption bug

2009-06-28 Thread Pierre Joye
committed. 2009/6/27 Johannes Schlüter : > On Fri, 2009-06-26 at 14:23 -0700, Andrei Zmievski wrote: >> I found what is effectively a memory corruption bug in all the branches. >> pecalloc() uses >> the wrong length to zero out the memory. Patch is attached, although I'm >> somewhat >> concerne

Re: [PHP-DEV] Memory corruption bug

2009-06-27 Thread Johannes Schlüter
On Fri, 2009-06-26 at 14:23 -0700, Andrei Zmievski wrote: > I found what is effectively a memory corruption bug in all the branches. > pecalloc() uses > the wrong length to zero out the memory. Patch is attached, although I'm > somewhat > concerned about using just (nmemb*len) instead of someth

Re: [PHP-DEV] Memory corruption bug

2009-06-26 Thread Pierre Joye
5.2 is already released so you can commit anyway. For 5.3, I'm not sure (well I am), but wait until Johannes and Lukas are back online please. On Sat, Jun 27, 2009 at 12:15 AM, Andrei Zmievski wrote: > Stanislav Malyshev wrote: >> >> You just did safe_address in _safe_malloc(nmemb, len, 0) which

Re: [PHP-DEV] Memory corruption bug

2009-06-26 Thread Andrei Zmievski
Stanislav Malyshev wrote: You just did safe_address in _safe_malloc(nmemb, len, 0) which should have called E_ERROR if nmemb*len overflows, so do you need to do it again? Leaving a comment about it wouldn't hurt though :) Yeah, you're right, but I didn't write the code. :) Regardless, I think

Re: [PHP-DEV] Memory corruption bug

2009-06-26 Thread Stanislav Malyshev
Hi! pecalloc() uses the wrong length to zero out the memory. Patch is attached, although I'm somewhat concerned about using just (nmemb*len) instead of something like safe_address(nmemb*len), but safe_address() is inlined in zend_alloc.c not in the header file. You just did safe_address in _

[PHP-DEV] Memory corruption bug

2009-06-26 Thread Andrei Zmievski
I found what is effectively a memory corruption bug in all the branches. pecalloc() uses the wrong length to zero out the memory. Patch is attached, although I'm somewhat concerned about using just (nmemb*len) instead of something like safe_address(nmemb*len), but safe_address() is inlined in ze