hroptatyr / dateutils

nifty command line date and time utilities; fast date calculations and conversion in the shell
http://www.fresse.org/dateutils/
Other
612 stars 40 forks source link

check before operator #78

Closed shenlanting closed 6 years ago

shenlanting commented 6 years ago

Hi, I am Lanting Shen from Qihoo360 CodeSafe Team. We found that calling function '__get_mdays(y, m)' may return value 0, then, operation ' (md - 28U)' may cause an Arithmetic Wrap-around Error. Although there is an 'assert' check, but the check is used after operation, so I just move it before the subtraction.

hroptatyr commented 6 years ago

Good catch, thank you.