Re: [PHP-DEV] base64_encode() memory issue

2004-12-30 Thread Ron Korving
My bad, sorry for wasting your time. Ron "Stefan Esser" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Hello, > > this issue was already cleared as bogus > > safe_emalloc already takes care of the one extra byte that should get added. > > safe_emalloc does allocate param1 * par

Re: [PHP-DEV] base64_encode() memory issue

2004-12-30 Thread Stefan Esser
Hello, this issue was already cleared as bogus safe_emalloc already takes care of the one extra byte that should get added. safe_emalloc does allocate param1 * param2 + param3 bytes result = (unsigned char *)safe_emalloc(((length + 2) / 3) * 4, sizeof(char), 1); would become result = (unsigned ch

Re: [PHP-DEV] base64_encode() memory issue

2004-12-30 Thread Ron Korving
Forgot to add that in my specific case valgrind mentioned an illegal read and write of 1 byte. Ron "Andi Gutmans" <[EMAIL PROTECTED]> schreef in bericht news:[EMAIL PROTECTED] > Do you have a patch which you think should be applied? If not, can you send > a reproducing script (a short one). Maybe

Re: [PHP-DEV] base64_encode() memory issue

2004-12-30 Thread Ron Korving
A patch (I'm not familiar with the normal protocol) would simply be to increase the allocated size by 1: result = (unsigned char *)safe_emalloc(((length + 2) / 3) * 4, sizeof(char), 1); would become result = (unsigned char *)safe_emalloc(((length + 2) / 3) * 4 + 1, sizeof(char), 1); But I must

Re: [PHP-DEV] base64_encode() memory issue

2004-12-29 Thread Andi Gutmans
Do you have a patch which you think should be applied? If not, can you send a reproducing script (a short one). Maybe you want to run it through valgrind and see where the damage is done. Andi At 04:44 PM 12/28/2004 +0100, Ron Korving wrote: Hi, I'm not sure how to test what I noticed, so I figu