[9] RFR: 8169715: jimage fails with IAE when attempts to inspect an empty file

Denis Kononenko 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.

  BUGURL: https://bugs.openjdk.java.net/browse/JDK-8169715
  WEBREV: http://cr.openjdk.java.net/~dkononenko/8169715/webrev.01

  Thank you,

More information about the core-libs-dev mailing list