Details
-
Bug
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
5.1
-
None
Description
Hi
Pass2Verifier.validJavaIdentifier must check the length of the parameter "name" otherwise an OutOfRange exception occurs when name.length() == 0. Here is the patch.
Index: Pass2Verifier.java =================================================================== RCS file: /cvsroot/bcel/JustIce/de/fub/bytecode/verifier/statics/Pass2Verifier.java, v retrieving revision 1.69 diff -u -r1.69 Pass2Verifier.java --- Pass2Verifier.java 12 Sep 2001 12:56:15 -0000 1.69 +++ Pass2Verifier.java 13 Jan 2004 11:12:40 -0000 @@ -1222,6 +1222,7 @@ * represents a valid Java identifier (so-called simple name). */ private static boolean validJavaIdentifier(String name){ + if (name.length() == 0) return false; // vmspec2 2.7, vmspec2 2.2 if (!Character.isJavaIdentifierStart(name.charAt(0))) return false;
Regards
FA