Skip to content

CronSequenceGenerator causes StackOverflowError with reversed range values [SPR-14462] #19031

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

Closed
spring-projects-issues opened this issue Jul 14, 2016 · 0 comments
Assignees
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Milestone

Comments

@spring-projects-issues
Copy link
Collaborator

spring-projects-issues commented Jul 14, 2016

Edward opened SPR-14462 and commented

CronSequenceGenerator next(Date date) method causes a StackOverflowError if there is a range value in the 'minutes' or 'hours' fields where the numbers are reversed.

For example :

public static void main(String[] s) {
    new CronSequenceGenerator("* 6-5 * * * *").next(new Date());
    System.out.println("Won't get here cos StackOverflowError");
}

It seems to me it is fixed by adding another check to the getRange(String field, int min, int max) method


Affects: 3.2.17, 4.2.7, 4.3.1

Issue Links:

Referenced from: commits da59b4d, 44152ce, 9be5404, e431624

Backported to: 4.2.8, 3.2.18

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core modules (aop, beans, core, context, expression) status: backported An issue that has been backported to maintenance branches type: bug A general bug
Projects
None yet
Development

No branches or pull requests

2 participants