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

CronSequenceGenerator constructor goes into infinite loop with invalid increments [SPR-12871] #17469

Closed
spring-issuemaster opened this issue Mar 31, 2015 · 2 comments

Comments

@spring-issuemaster
Copy link
Collaborator

commented Mar 31, 2015

Edward opened SPR-12871 and commented

The constructor for the org.springframework.scheduling.support.CronSequenceGenerator will go into an infinite loop if one of the fields is of the form n/0

For example

public static void main (String[] s) {
    new CronSequenceGenerator("*/0 * * * * *");
    System.out.println("We will never get here");
}

I guess that either the /0 should be ignored, or it should throw an IllegalArgumentException


Affects: 3.2.13, 4.1.6

Issue Links:

  • #19158 CronSequenceGenerator.next() is not implemented as documented
  • #19031 CronSequenceGenerator causes StackOverflowError with reversed range values

Referenced from: commits ceb17fc, b5a56ca, 50f4977

Backported to: 3.2.14

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 1, 2015

Juergen Hoeller commented

Good catch. We're explicitly checking the incrementer delta to be 1 or higher now, raising a descriptive IllegalArgumentException if invalid. (Negative deltas led to a non-descriptive IndexOutOfBoundsException before.)

Juergen

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Apr 1, 2015

Edward commented

Awesome - impressive turnaround!

Best regards
Ed

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.