mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
CronSequenceGenerator prevents stack overflow in case of inverted range
Issue: SPR-14462
(cherry picked from commit da59b4d)
This commit is contained in:
+5
-1
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright 2002-2015 the original author or authors.
|
||||
* Copyright 2002-2016 the original author or authors.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
@@ -379,6 +379,10 @@ public class CronSequenceGenerator {
|
||||
throw new IllegalArgumentException("Range less than minimum (" + min + "): '" +
|
||||
field + "' in expression \"" + this.expression + "\"");
|
||||
}
|
||||
if (result[0] > result[1]) {
|
||||
throw new IllegalArgumentException("Invalid inverted range: '" + field +
|
||||
"' in expression \"" + this.expression + "\"");
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user