mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Tokenizer uses single process step and length-based exhaustion check
Issue: SPR-16032
This commit is contained in:
+11
@@ -59,6 +59,7 @@ import org.springframework.expression.spel.support.ReflectivePropertyAccessor;
|
||||
import org.springframework.expression.spel.support.StandardEvaluationContext;
|
||||
import org.springframework.expression.spel.support.StandardTypeLocator;
|
||||
import org.springframework.expression.spel.testresources.le.div.mod.reserved.Reserver;
|
||||
import org.springframework.util.ObjectUtils;
|
||||
|
||||
import static org.hamcrest.Matchers.*;
|
||||
import static org.junit.Assert.*;
|
||||
@@ -2095,6 +2096,16 @@ public class SpelReproTests extends AbstractExpressionTests {
|
||||
assertEquals(StandardCharsets.UTF_8, result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void SPR16032() {
|
||||
EvaluationContext context = new StandardEvaluationContext();
|
||||
context.setVariable("str", "a\0b");
|
||||
|
||||
Expression ex = parser.parseExpression("#str?.split('\0')");
|
||||
Object result = ex.getValue(context);
|
||||
assertTrue(ObjectUtils.nullSafeEquals(result, new String[] {"a", "b"}));
|
||||
}
|
||||
|
||||
|
||||
public static class ListOf {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user