Skip to content

Comments

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

Open
jbinary wants to merge 2 commits intolloyd:masterfrom
jbinary:master
Open

Fixes incorrect lower bound for integers (#130)#251
jbinary wants to merge 2 commits intolloyd:masterfrom
jbinary:master

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

jbinary added 2 commits May 11, 2023 13:54
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