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

Fixes incorrect lower bound for integers (#130) #251

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

jbinary
Copy link

@jbinary jbinary commented May 11, 2023

The yajl_parse_integer() routine sets the errno to ERANGE if the string "-9223372036854775808", even though this value is still representable as a long long

The yajl_parse_integer() routine sets the errno to ERANGE if the string
"-9223372036854775808", even though this value is still representable as
a long long
during the fix of correctly parsing LLONG_MIN value I added a bug when a
number having all the first numbers coniciding with LLONG_MIN but also
having more numbers, like -92233720368547758080 would not raise an
exception as expected

this fix uses the bigger half, which is negative to compute the number
instead, so there's no initial issue when we just can't hold enough
numbers in our number space
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.

1 participant