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:
Luke Taylor 2008-08-05 23:26:01 +00:00
parent fbeb47d559
commit 3ee3591feb
1 changed files with 22 additions and 18 deletions

View File

@ -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;