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

OSS-Fuzz issue 40999 #2110

Closed
oss-fuzz-robot opened this issue Apr 21, 2022 · 4 comments
Closed

OSS-Fuzz issue 40999 #2110

oss-fuzz-robot opened this issue Apr 21, 2022 · 4 comments
Labels

Comments

@oss-fuzz-robot
Copy link

OSS-Fuzz has found a bug in this project. Please see https://oss-fuzz.com/testcase?key=5741446309740544 for details and reproducers.

This issue is mirrored from https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40999 and will auto-close if the status changes there.

If you have trouble accessing this report, please file an issue at https://github.com/google/oss-fuzz/issues/new.

@Marcono1234
Copy link
Collaborator

Exception handling in com.google.gson.JsonStreamParser.next() seems to be questionable. This bug occurs because it treats a JsonParseException with EOFException as cause as if no element existed and throws a NoSuchElementException (even though hasNext() returned true before).

Simple reproducer based on the fuzzer data:

JsonStreamParser parser = new JsonStreamParser("[");
assertTrue(parser.hasNext());
// Throws NoSuchElementException
parser.next();

@Marcono1234 Marcono1234 added the bug label Aug 2, 2022
@oss-fuzz-robot
Copy link
Author

OSS-Fuzz has closed this bug. Please see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40999 for details.

@Marcono1234
Copy link
Collaborator

Reopening this because the code causing this was not fixed as far as I know, so it appears this issue was closed erroneously, see also https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40999#c6.

@oss-fuzz-robot
Copy link
Author

OSS-Fuzz has closed this bug. Please see https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=40999 for details.

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

No branches or pull requests

2 participants