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
Mon Nov 22 13:52:21 UTC 2010
Xueming Shen wrote:
> Alan,
>
> After staring those simple, 11 lines of change for minutes, I believe
> we should simply
> go back with the original approach at
>
> http://cr.openjdk.java.net/~sherman/6858865/webrev.00
>
> The change in
> http://cr.openjdk.java.net/~sherman/6858865/webrev.00
>
> obviously is problematic, especially in case like in_len == 0 but
> out_len != 0 (no more,
> or no more new input, but with a valid output buffer), it's definitely
> possible the
> inflater/deflater might have more bites to (and should) output in this
> scenario, it's a
> bug to return 0 here.
>
> Sure it's possible to go further like
>
> if (in_len == 0)
> return 0;
> ....
>
> if (len == 0)
> ...
>
> But given the purpose of this fix is to solve that particular
> "regression" (which actually
> does not cause any regression for "mainstream" platforms), I prefer
> not take the risk
> of causing another real regression/behavior change here, especially we
> got burned
> couple times here in the past when tried to do better.
>
> Agree?
>
> -Sherman
I understand the concern but I don't think that patch-1 is risky. That
is, for Inflater, I can't see any side effects to simply returning 0 if
either length is 0. Same thing for Deflater when not in the code path
that calls deflateParams. For the deflateParams cases then the changes
in the latest patch is fine with me.
-Alan.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.openjdk.java.net/pipermail/core-libs-dev/attachments/20101122/2a4a98e1/attachment.html>
More information about the core-libs-dev
mailing list