kelektiv / node-cron

Cron for NodeJS.
MIT License
8.31k stars 617 forks source link

cron runs into infinite loop when providing two or more zeros as step #742

Closed sheerlox closed 8 months ago

sheerlox commented 8 months ago

Description

When providing two or more zeros as step in a cron expression (e.g. */00 0 * * *), cron runs into an infinite loop instead of throwing an "Invalid step" error.

Expected Behavior

should throw an "Invalid step" error when providing any number of zeros as a step.

Actual Behavior

does not detect the step is invalid, and runs into a blocking infinite loop (even when not starting the job).

Possible Fix

No response

Steps to Reproduce

new CronJob('* * * 1/00 *', function () {
  console.log('tick');
});

Context

found this bug while adding fuzz tests (as part of #715)

Your Environment

ncb000gt commented 8 months ago

:tada: This issue has been resolved in version 3.1.5 :tada:

The release is available on:

Your semantic-release bot :package::rocket: