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

Panic when parsing long float #52

Closed
dtolnay opened this issue Jul 1, 2016 · 1 comment
Closed

Panic when parsing long float #52

dtolnay opened this issue Jul 1, 2016 · 1 comment
Labels

Comments

@dtolnay
Copy link

dtolnay commented Jul 1, 2016

json::parse("2.22507385850720113605740979670913197593481954635164564e-308").unwrap();
thread 'main' panicked at 'attempted to add with overflow', /home/david/.cargo/git/checkouts/json-rust-8fc837b9d242b7ce/0.8.5/src/parser.rs:401

This is on the 0.8.5 branch.

@maciejhirsz
Copy link
Owner

Aye, I'm aware, left myself a comment :)

            // FIXME: prevent overflowing!
            read_num!(self, digit, {
                f = (f << 1) + (f << 3) + digit as u64;
                p = (p << 1) + (p << 3);
            });

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