RFR: 8169715: jimage fails with IAE when attempts to inspect an empty file
denis.kononenko at oracle.com
Thu Feb 9 18:27:30 UTC 2017
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.
More information about the jigsaw-dev