Code review request 6858865: Fix for 6728376 causes regression if the size of "data" is 0 and malloc returns Null for 0-length
Alan Bateman
Alan.Bateman at oracle.com
Fri Nov 19 17:55:58 UTC 2010
Xueming Shen wrote:
> :
> We can probably do that for Inflater.c (and probably better do that at
> java level before
> we even "come down" here), but thing gets a little complicated for
> Deflater. One of the
> paths of the deflateBytes is to deal with parameter(s) change, so if
> malloc does not
> fail for 0-length request (true on all supported platforms), the
> deflateBytes goes down
> to zlib's deflateParams() and if there is nothing left to flush,
> "this" invocation can successfully
> re-set the param(s) and return 0. The reason why I decided to go with
> the "safe and simple"
> solution last night, the proposed webrev at least should behave the
> exactly the same as it
> was before.
>
> -Sherman
>
I think it would be a bit cleaner for inflater. For deflater would it
cleaner to just skip the mallocs when the lengths are 0 (for the
deflateParams path).
-Alan.
More information about the core-libs-dev
mailing list