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

Duration::new panics in Readable impl #64

Open
caibear opened this issue Feb 11, 2024 · 0 comments
Open

Duration::new panics in Readable impl #64

caibear opened this issue Feb 11, 2024 · 0 comments

Comments

@caibear
Copy link

caibear commented Feb 11, 2024

speedy = "0.8.7"
use speedy::Readable;
let _ = std::time::Duration::read_from_buffer(&[255; 12]);

Results in thread 'main' panicked at 'overflow in Duration::new. Could fix by checking nanos < 1_000_000_000 before calling Duration::new in speedy::Readable since speedy::Writable uses Duration::subsec_nanos which always meets that requirement.

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

No branches or pull requests

1 participant