Uploaded image for project: 'Commons BCEL'
  1. Commons BCEL
  2. BCEL-37

OutOfRange exception in Pass2Verifier.validJavaIdentifier

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 5.1
    • 5.2
    • Main
    • 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

      Attachments

        Activity

          People

            issues@commons.apache.org Apache Commons Developers
            francis.andre@easynet.fr Francis ANDRE
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: