Hi all,
I've found a problem in the Deflater code in OpenJDK, where a length of
zero bytes is passed to malloc.
According to the specs, malloc may return either a valid pointer that
can be passed to free, or NULL, while generally NULL is considered to be
a failure. Linux and Solaris, albeit
Hi Mario,
> According to the specs, malloc may return either a valid pointer that
> can be passed to free, or NULL, while generally NULL is considered to be
> a failure. Linux and Solaris, albeit non specifying it, return always a
> valid pointer, as far as I know
I think NULL is returned in a
Il 08/07/2009 20:52, Roman Kennke ha scritto:
Hi Mario,
According to the specs, malloc may return either a valid pointer that
can be passed to free, or NULL, while generally NULL is considered to be
a failure. Linux and Solaris, albeit non specifying it, return always a
valid pointer, as far as
Hi Mario,
> >> According to the specs, malloc may return either a valid pointer that
> >> can be passed to free, or NULL, while generally NULL is considered to be
> >> a failure. Linux and Solaris, albeit non specifying it, return always a
> >> valid pointer, as far as I know
> >
> > I think NULL
Hi Mario,
I'm not familiar with this particular code but doesn't a value of
this_len==0 imply that there's nothing to do and a whole chunk of code
here can be skipped? Is finding this_len==0 even valid here?
Your patch fixes your problem, but it seems to me the code either
shouldn't get this
I tend to agree.
Shouldn't a zero length entry be treated special, or disallowed?
-kto
David Holmes - Sun Microsystems wrote:
Hi Mario,
I'm not familiar with this particular code but doesn't a value of
this_len==0 imply that there's nothing to do and a whole chunk of code
here can be skippe
Zero length entry should be allowed. This is a regression, the result of the
un-successful fix for 6728376:-(
The webrev for 6728376 is
http://cr.openjdk.java.net/~sherman/6728376/webrev
We have the same in Inflater as well. I will file a bug for it.
Thanks Mario for catching this.
Sherman
K
Il 09/07/2009 18:57, Kelly O'Hair ha scritto:
I tend to agree.
Shouldn't a zero length entry be treated special, or disallowed?
-kto
Hi Kelly,
Maybe I misunderstood the code, because I didn't went into it in so
great details, but I think that the zero length is already considered
special b
Il 09/07/2009 19:41, Xueming Shen ha scritto:
Zero length entry should be allowed. This is a regression, the result of
the
un-successful fix for 6728376:-(
The webrev for 6728376 is
http://cr.openjdk.java.net/~sherman/6728376/webrev
We have the same in Inflater as well. I will file a bug for i