[9] RFR: 8169715: jimage fails with IAE when attempts to inspect an empty file
Andrey Nazarov
andrey.x.nazarov at oracle.com
Mon Feb 13 18:05:10 UTC 2017
Looks good
> On 13 Feb 2017, at 20:58, Denis Kononenko <denis.kononenko at oracle.com> wrote:
>
>
> Hi,
>
> Optimized buffer's capacity checks.
>
> WEBREV: http://cr.openjdk.java.net/~dkononenko/8169715/webrev.02 <http://cr.openjdk.java.net/~dkononenko/8169715/webrev.02>
>
>>
>> Could please someone review the fix for JDK-8169715.
>>
>> The problem occurs when jimage tool is attempting to read an empty or
>> incomplete image. The current implementation works with ByteBuffer and
>> always relies on that there's enough data to inspect the image. This
>> results in IAE inside of BasicImageReader.slice method when the buffer
>> is smaller then it's expected.
>>
>> I added a few checks to avoid IAE and throw IOException with a more
>> descriptive text.
>>
>>
>> BUGURL: https://bugs.openjdk.java.net/browse/JDK-8169715
>> WEBREV: http://cr.openjdk.java.net/~dkononenko/8169715/webrev.01
>>
>> Thank you,
>> Denis.
>
> Thank you,
> Denis.
More information about the jigsaw-dev
mailing list