Skip to content

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

Closed
@spring-projects-issues

Description

@spring-projects-issues

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

Metadata

Metadata

Assignees

Labels

in: coreIssues in core modules (aop, beans, core, context, expression)status: backportedAn issue that has been backported to maintenance branchestype: bugA general bug

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions