Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8280404

Unexpected exception thrown when CEN file entry comment length is not valid

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P4 P4
    • 19
    • None
    • core-libs
    • None
    • b13
    • generic
    • generic

      A fuzzed signed jar throws an exception when retrieving the
      manifest entry, this seems to be due to a miscalculated offset while UTF8
      decoding:

      java JarTest iae_malformat_input.jar
      Exception in thread "main" java.lang.IllegalArgumentException: malformed
      input off : 80, length : 1
      at java.base/java.lang.StringCoding.throwMalformed(StringCoding.java:698)
      at java.base/java.lang.StringCoding.decodeUTF8_0(StringCoding.java:885)
      at
      java.base/java.lang.StringCoding.newStringUTF8NoRepl(StringCoding.java:978)
      at java.base/java.lang.System$2.newStringUTF8NoRepl(System.java:2273)
      at java.base/java.util.zip.ZipCoder$UTF8ZipCoder.toString(ZipCoder.java:208)
      at java.base/java.util.zip.ZipFile.getZipEntry(ZipFile.java:671)
      at java.base/java.util.zip.ZipFile.getEntry(ZipFile.java:330)
      at java.base/java.util.jar.JarFile.getManEntry(JarFile.java:935)
      at
      java.base/java.util.jar.JarFile.getManifestFromReference(JarFile.java:417)
      at java.base/java.util.jar.JarFile.getManifest(JarFile.java:409)
      at JarTest.main(JarTest.java:12)
      Caused by: java.nio.charset.MalformedInputException: Input length = 1

            lancea Lance Andersen
            jeff Jeff Dinkins
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: