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

“ArrayIndexOutOfBoundsException”The input array size is larger than the array limit #2781

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

Comments

@Cici-Musse-Lee
Copy link

The file path is org.zkoss.json.parser.Yylex.
In our test case, pass int1=2147483647 into the function whose api is yycharat().
Inside this api, an array with a size greater than 2147483647 will be created, and an array out-of-bounds exception will be generated at this time.

source code:

public final char yycharat (int pos){
        return zzBuffer[zzStartRead[pos];
}

test code:

public void test_yycharat_1_36() throws NoSuchFieldException,IllegalAccessException{
        int int1=2147483647;
        java.io.Reader reader2 = null;

        org.zkoss.json.parser.Yylex yylex0 = new org.zkoss.json.parser.Yylex(reader2);
        yylex0.yycharat(int1);
}

test result:

java.lang.ArraylndexOutOfBoundsException:Index 2147483647 out of bounds for length 16384
at org.zkoss.json.parser.Yylex.yycharat(Yylex.java:439)
at org.zkoss.json.parser.Yylex_Test.test_yycharat_1_36(Yylex_Test.java:596)
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