[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: gawk: free_wstr() invalid write
From: |
Aharon Robbins |
Subject: |
Re: gawk: free_wstr() invalid write |
Date: |
Mon, 01 Jan 2007 22:25:30 +0200 |
Greetings. Re this:
> Date: Mon, 18 Dec 2006 19:34:56 +0300
> From: "Dmitry V. Levin" <address@hidden>
> Subject: Re: gawk: free_wstr() invalid write
> To: "Andrew J. Schorr" <address@hidden>
> Cc: address@hidden
>
>
> On Mon, Dec 18, 2006 at 11:03:30AM -0500, Andrew J. Schorr wrote:
> > On Mon, Dec 18, 2006 at 06:27:52PM +0300, Dmitry V. Levin wrote:
> > > free_wstr() zeroes wstptr and wstlen pointers even if WSTRCUR flag is not
> > > set, which is wrong and may lead to invalid write, similar to invalid free
> > > in str2wstr().
> > >
> > > Proposed fix is attached.
> >
> > FYI, your str2str and free_wstr patches seem correct to me,
> > and they resemble the code in the xgawk source tree:
> >
> > http://sourceforge.net/projects/xmlgawk/
>
> Why these fixes are not in gawk-stable tree yet? :)
This is what free_wstr() looks like in my tree:
/* free_wstr --- release the wide string part of a node */
void
free_wstr(NODE *n)
{
if ((n->flags & WSTRCUR) != 0) {
assert(n->wstptr != NULL);
free(n->wstptr);
}
n->wstptr = NULL;
n->wstlen = 0;
n->flags &= ~WSTRCUR;
}
It should have been in the gawk-stable CVS repository for a while now. If
it's not, then something isn't propograting correctly.
I just now rsync'ed the copy of my CVS repository to the machine from which
Savannah is supposed to get its copy. Here's the first line of the ChangeLog:
> Thu Dec 21 14:32:13 2006 Arnold D. Robbins <address@hidden>
If that isn't on Savannah by sometime on January 2, there's a problem.
Thanks,
Arnold
- Re: gawk: free_wstr() invalid write,
Aharon Robbins <=