This is an automated email from the ASF dual-hosted git repository.
markt-asf pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new b76e9e34de Review "Avoid StringIndexOutOfBoundsException on an empty
..."
b76e9e34de is described below
commit b76e9e34ded453e3e95f17726f0ee3b6db707f1a
Author: Mark Thomas <[email protected]>
AuthorDate: Fri Nov 6 10:35:21 2026 +0000
Review "Avoid StringIndexOutOfBoundsException on an empty ..."
Fix additional variations of the same issue
Co-authored by: Claude / Sonnet 5.5
---
java/org/apache/jasper/tagplugins/jstl/Util.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/jasper/tagplugins/jstl/Util.java
b/java/org/apache/jasper/tagplugins/jstl/Util.java
index 93a1a77559..bc5a8770d9 100644
--- a/java/org/apache/jasper/tagplugins/jstl/Util.java
+++ b/java/org/apache/jasper/tagplugins/jstl/Util.java
@@ -163,7 +163,9 @@ public class Util {
end = input.length();
}
}
- return JreCompat.getInstance().strip(input.substring(begin, end));
+ String value = JreCompat.getInstance().strip(input.substring(begin,
end));
+ // An empty value (e.g. charset="" or charset=;foo=bar) is treated the
same as an absent attribute
+ return value.isEmpty() ? null : value;
}
/**
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]