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

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

Closed
sheerlox opened this issue Oct 23, 2023 · 1 comment · Fixed by #743
Closed

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

sheerlox opened this issue Oct 23, 2023 · 1 comment · Fixed by #743
Labels
released type:bug Bug reports and bug fixes

Comments

@sheerlox
Copy link
Collaborator

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

  • cron version: 3.1.3
  • NodeJS version: 18.17.1
  • Operating System and version: Ubuntu 22.04.3
  • TypeScript version (if applicable):
  • Link to your project (if applicable):
@sheerlox sheerlox added the type:bug Bug reports and bug fixes label Oct 23, 2023
@sheerlox sheerlox self-assigned this Oct 23, 2023
@sheerlox sheerlox removed their assignment Oct 23, 2023
@ncb000gt
Copy link
Member

🎉 This issue has been resolved in version 3.1.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
released type:bug Bug reports and bug fixes
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants