commons-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Emmanuel Bourg (JIRA)" <j...@apache.org>
Subject [jira] [Updated] (BCEL-37) OutOfRange exception in Pass2Verifier.validJavaIdentifier
Date Thu, 24 Apr 2014 12:37:18 GMT

     [ https://issues.apache.org/jira/browse/BCEL-37?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]

Emmanuel Bourg updated BCEL-37:
-------------------------------

      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.

{code}
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;
{code}

Regards

FA

  was:
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

         Priority: Major
      Environment:     (was: Operating System: other
Platform: Other)
    Fix Version/s: 5.2
         Priority:   (was: P3)
         Severity:   (was: normal)

> OutOfRange exception in Pass2Verifier.validJavaIdentifier
> ---------------------------------------------------------
>
>                 Key: BCEL-37
>                 URL: https://issues.apache.org/jira/browse/BCEL-37
>             Project: Commons BCEL
>          Issue Type: Bug
>          Components: Main
>    Affects Versions: 5.1
>            Reporter: Francis ANDRE
>            Assignee: Apache Commons Developers
>             Fix For: 5.2
>
>
> Hi
> Pass2Verifier.validJavaIdentifier must check the length of the parameter "name" otherwise
an OutOfRange exception occurs when name.length() == 0. Here is the patch.
> {code}
> 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;
> {code}
> Regards
> FA



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Mime
View raw message