Re: base64_encode() memory issue
| From: | Ron Korving | Date: | Thu, 30 Dec 2004 08:28:56 +0000 |
| Subject: | Re: base64_encode() memory issue | ||
| References: | 1 2 | Groups: | php.internals |
| Request: | Send a blank email to internals+get-14238@lists.php.net to get a copy of this message | ||
Forgot to add that in my specific case valgrind mentioned an illegal read
and write of 1 byte.
Ron
"Andi Gutmans" <andi@zend.com> schreef in bericht
news:5.1.0.14.2.20041229174350.02ed81c0@localhost...
> 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 figured I would post this
here
> >and see if any of you could test it and see if I'm correct. When I test
this
> >in a non-PHP environment with malloc(), this does present a problem
however,
> >and when running segfaults randomly appear because of it.
> >
> >In base64.c, the string is closed with a \0 byte, but this one byte is
never
> >allocated. Since it's just 1 byte, this often happens without causing
> >trouble, but every once in a while it does cause a segfault. I hope
someone
> >can confirm this.
> >
> >Happy holidays,
> >
> >Ron
> >
> >--
> >PHP Internals - PHP Runtime Development Mailing List
> >To unsubscribe, visit: http://www.php.net/unsub.php