-
-
Notifications
You must be signed in to change notification settings - Fork 797
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 from UTF32Reader.read on invalid input #382
Comments
Thank you for reporting this. It probably doesn't come as a big surprise, but usage for UTF-32 is rather low, and as such we don't often get bug reports, compared to UTF-8. And existing testing is bit limited (there is some but only for simplest use cases). |
Does indeed look like input is invalid. But I agree it should be handled in proper manner as an |
Indeed I'm not surprised. Most of our normal valid input is UTF-8. As I said this one popped out of a fuzz test. Thought I would provide a patch as it seemed reasonably simple to deal with using the existing unexpected end of file functionality. |
@wselwood yes, much appreciated! |
@wselwood Thank you for reporting this, providing fix -- I ended up merging manually, using test, partly for backporting, and partly as I wanted to change code in related parts. Fix will be in 2.8.9, 2.9.0(.pr4) |
Fair enough @cowtowncoder . You did a much better job of the fix and tests than I did. Thanks for the quick work. |
We are doing some fuzz testing on internal projects and found some input that causes an unexpected exception from JsonParser. While it is throwing an exception and stopping on this, it should probably be some kind of IOException rather than an ArrayIndexOutOfBoundsException.
In our case we are catching the three exception types listed in ObjectMapper.readTree (JsonParseException | JsonProcessingException | IOException) and this managed to escape.
Simple test case follows
stack trace:
The text was updated successfully, but these errors were encountered: