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: 200" when parsing a big number #160

Closed
spydesk opened this issue Oct 14, 2014 · 2 comments
Closed

Comments

@spydesk
Copy link

spydesk commented Oct 14, 2014

The following code fails with jackson-core version 2.4.3 :

@Test
public void test() throws JsonParseException, IOException {

    StringBuilder input = new StringBuilder();
    for (int i = 0; i < 500; i++) {
        input.append(1);
    }

    JsonFactory factory = new JsonFactory();

    JsonParser parser =
        factory.createParser(new ByteArrayInputStream(input.toString().getBytes(Charset.forName("UTF-8"))));

    parser.nextToken();
}

Result :

java.lang.ArrayIndexOutOfBoundsException: 200
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._parsePosNumber(UTF8StreamJsonParser.java:1216)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser._nextTokenNotInObject(UTF8StreamJsonParser.java:792)
    at com.fasterxml.jackson.core.json.UTF8StreamJsonParser.nextToken(UTF8StreamJsonParser.java:690)

This looks related to #78...

@cowtowncoder
Copy link
Member

Hmmh. I would have thought it'd be #157 but sounds like it isn't. Dang.

@cowtowncoder
Copy link
Member

Oh. It is, actually; but #157 was not included in 2.4.3 yet. So, duplicate.

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

2 participants