DO NOT REPLY [Bug 26087] New: - OutOfRange exception in Pass2Verifier.validJavaIdentifier

[email protected]
Newsgroups gmane.comp.jakarta.bcel.devel
Message-ID <[email protected]>
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26087>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=26087

OutOfRange exception in Pass2Verifier.validJavaIdentifier

           Summary: OutOfRange exception in
                    Pass2Verifier.validJavaIdentifier
           Product: BCEL
           Version: 5.1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Normal
          Priority: Other
         Component: Main
        AssignedTo: [email protected]
        ReportedBy: [email protected]


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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.