Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

java.lang.ArrayIndexOutOfBoundsException:Index -808430919 out of bounds for length 4 #2785

Open
Cici-Musse-Lee opened this issue May 31, 2022 · 0 comments

Comments

@Cici-Musse-Lee
Copy link

Cici-Musse-Lee commented May 31, 2022

The file path is org.zkoss.lang.JavaScriptEscapeUtil
java.lang.ArrayIndexOutOfBoundsException:Index -808430919 out of bounds for length 4
In our test case, pass int1,int2 and int3 into the function.
Inside this api, an array with a size greater than -808430919 will be created, and an array out-of-bounds exception will be generated at this time.
source code:

static int parseIntFromReference(final char[]text,final int start,final int end,final int radix){
      int result 0;
      for (int i=start;i<end;i++){
      final char c=text[i];int n =-1;
      for (int=0;<HEXA CHARS UPPER.length;++){
            if (C =HEXA CHARS UPPER[]C==HEXA CHARS LOWER[]){
                  n=j;
                  break;
            }
      }
}

test code:

public void test_parseIntFromReference_1_21()throws NoSuchFieldException,IllegalAccessException{
        int int2=847934538:
        char[]charArray0={'\'',\'','\'',\''};
        int int1=-808430919;
        int int3=-568520861;  
org.zkoss.lang.JavascriptEscapeutil.parseIntFromReference(charArray0,int1,int2,int3);
}

test results:

java.lang.ArrayIndexOutOfBoundsException:Index -808430919 out of bounds for length 4
at org.zkoss.lang.JavaScriptEscapeUtil.parselntFromReference(JavaScriptEscapeUtil.java:543)
at org.zkoss.lang.JavaScriptEscapeUtil_Test.test_parselntFromReference_1_21(JavaScriptEscapeUtil_Test.java:334)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant