Closed HeeillWang closed 1 year ago
Case 1 results in wrapping in release mode, which is an issue. I pushed a commit to avoid this by using checked multiplication.
Case 2 is the same as #623, as panicking on division by zero is very much intentional.
Closing as case 1 has been resolved.
I executed fuzzing, and found arithmetic overflow bug on date.rs. Tested on 0.3.22 but would be reproduced on latest version. Here I omits detailed reproduction steps, as those cases looks quite obvious... Please let me know anyone needs more details.
Case-1 :
NumericalStdDuration
impl foru64
https://github.com/time-rs/time/blob/c96bb1a4474b9af1289edbdf34514fbfe95fa833/time/src/ext.rs#L222-L236
Case-2
https://github.com/time-rs/time/blob/c96bb1a4474b9af1289edbdf34514fbfe95fa833/time/src/duration.rs#L1348-L1379
Expected patch