Lightweight, fast and dependency-free Cron expression parser (due checker, next/prev due date finder), task runner, job scheduler and/or daemon for Golang (tested on v1.13+) and standalone usage. If you are bold, use it to replace crontab entirely.
thanks for reporting. negative step is already invalid case so i think we can give out error right away here. your suggested fix is also fine, please send a PR, thank you
I've been trying out fuzzing gronx and have found you can set a negative step in a cron expression, e.g.
0-0/-005 * * * *
This negative step causes an infinite loop in
inStepRange()
Stepping through we can resolve by checking if
step <= 0
https://github.com/adhocore/gronx/blob/28b4284153644ff3013b01570bc2a7c53f6eb60b/validator.go#L17
This is the fuzzer I was testing with