SEC-947: Added check on "before" and "after" values to make sure they don't overflow when decremented/incremented respectfully.
This commit is contained in:
parent
fbeb47d559
commit
3ee3591feb
|
@ -70,11 +70,15 @@ public class OrderedFilterBeanDefinitionDecorator implements BeanDefinitionDecor
|
|||
}
|
||||
|
||||
if (StringUtils.hasText(after)) {
|
||||
return Integer.toString(FilterChainOrder.getOrder(after) + 1);
|
||||
int order = FilterChainOrder.getOrder(after);
|
||||
|
||||
return Integer.toString(order == Integer.MAX_VALUE ? order : order + 1);
|
||||
}
|
||||
|
||||
if (StringUtils.hasText(before)) {
|
||||
return Integer.toString(FilterChainOrder.getOrder(before) - 1);
|
||||
int order = FilterChainOrder.getOrder(before);
|
||||
|
||||
return Integer.toString(order == Integer.MIN_VALUE ? order : order - 1);
|
||||
}
|
||||
|
||||
return null;
|
||||
|
|
Loading…
Reference in New Issue