-
Bug
-
Resolution: Fixed
-
P4
-
9, 11, 16
-
b20
Issue | Fix Version | Assignee | Priority | Status | Resolution | Resolved In Build |
---|---|---|---|---|---|---|
JDK-8270069 | 11.0.13-oracle | Prajwal Kumaraswamy | P4 | Resolved | Fixed | b02 |
JDK-8272429 | 11.0.13 | Aleksey Shipilev | P4 | Resolved | Fixed | b03 |
JDK-8270138 | 8u311 | Prajwal Kumaraswamy | P4 | Resolved | Fixed | b02 |
JDK-8270141 | 7u321 | Prajwal Kumaraswamy | P4 | Resolved | Fixed | b02 |
$ mkdir META-INF
$ dd if=/dev/zero of=META-INF/MANIFEST.MF bs=1m count=2048
$ zip -r foo.jar META-INF
(Note that the resulting jar file will have a malformed manifest.)
Then open the jar file, either by putting it on the classpath, or by opening it using the JarFile API and reading the manifest:
$ java -cp foo.jar X
Error: A JNI error has occurred, please check your installation and try again
Exception in thread "main" java.lang.NegativeArraySizeException
jshell> new java.util.jar.JarFile("foo.jar").getManifest()
| Exception java.lang.NegativeArraySizeException: -2147483648
If the manifest is too large to be read into memory, OutOfMemoryError should be thrown instead.
- backported by
-
JDK-8270069 opening jar file with large manifest might throw NegativeArraySizeException
- Resolved
-
JDK-8270138 opening jar file with large manifest might throw NegativeArraySizeException
- Resolved
-
JDK-8270141 opening jar file with large manifest might throw NegativeArraySizeException
- Resolved
-
JDK-8272429 opening jar file with large manifest might throw NegativeArraySizeException
- Resolved
- links to
-
Commit openjdk/jdk11u-dev/7b6f391b
-
Commit openjdk/jdk/782d45bd
-
Review openjdk/jdk11u-dev/225
-
Review openjdk/jdk/323