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

Disallow empty exponent in JSON parsing #251

Merged
merged 1 commit into from
Jul 22, 2024

Conversation

LeszekSwirski
Copy link
Collaborator

The JSON spec requires at least one digit in the exponential part, if
specified.

The JSON spec requires at least one digit in the exponential part, if
specified.
@lemire
Copy link
Member

lemire commented Jul 22, 2024

Running tests

@lemire
Copy link
Member

lemire commented Jul 22, 2024

The GCC 13 CI error appears unrelated.

@lemire
Copy link
Member

lemire commented Jul 22, 2024

I am going to merge this and release a patch. The fix seems obviously needed. There is a problem with GCC 13 in CI, but I will fix it separately before releasing.

@lemire lemire merged commit 9468d50 into fastfloat:main Jul 22, 2024
36 of 37 checks passed
@LeszekSwirski
Copy link
Collaborator Author

So giving this a second thought, I'm not sure it's correct -- fast_float is tolerant of junk after the number, and for 1.0e, parsing this as 1.0 with trailing junk e is a valid parse. I think we should revert this and instead make tests check for the where the returned pointer ended up.

LeszekSwirski added a commit that referenced this pull request Jul 23, 2024
Revert #251, and instead allow an invalid trailing empty exponent to be
treated as junk data in JSON parsing. Expand the test suite to test this
case, including testing the trailing junk.
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

Successfully merging this pull request may close these issues.

2 participants