-
CSR
-
Resolution: Unresolved
-
P4
-
None
-
low
-
SE
Summary
Note that Signature and nominal descriptors may carry over-java.lang.classfile.constantpool.Utf8Entry limit strings, and prevent the construction of unwritableUtf8Entry`.
Problem
java.lang.classfile.constantpool.Utf8Entry can be constructed with oversized String instances that cannot be encoded in the class file format. Such errors are reported only when class files are written, which allows invalid instances to float around in the runtime, which makes such failures hard to track.
Related to this issue is that java.lang.constant nominal descriptors and java.lang.classfile.(Class|Method|)Signature may be constructed with oversized string representations.
Solution
Reject oversized Strings used to construct Utf8Entry, so they now fail immediately with an IllegalArgumentException.
Reject using oversized nominal descriptor or signature for constructing Utf8Entry. Warn of such risks on the nominal descriptors and signature modeling classes.
Specification
See the attached specification diff.
- csr of
-
JDK-8367585 Move Utf8Entry length validation earlier
-
- Open
-