You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2023/11/27 14:09:29 UTC
(tomcat) 03/04: Add comment on why >= rather than == is used
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit 45259a06e1a8bf04bff9529e99798c582e5aba34
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Mon Nov 27 13:47:03 2023 +0000
Add comment on why >= rather than == is used
---
java/jakarta/el/CompositeELResolver.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/jakarta/el/CompositeELResolver.java b/java/jakarta/el/CompositeELResolver.java
index 6cf9fda0be..401c898356 100644
--- a/java/jakarta/el/CompositeELResolver.java
+++ b/java/jakarta/el/CompositeELResolver.java
@@ -46,6 +46,10 @@ public class CompositeELResolver extends ELResolver {
public void add(ELResolver elResolver) {
Objects.requireNonNull(elResolver);
+ /*
+ * resolversSize should never be larger than resolvers.length. If it ever is, the code will fail when execution
+ * reaches System.arraycopy with an IndexOutOfBoundsException.
+ */
if (resolversSize >= resolvers.length) {
ELResolver[] nr = new ELResolver[resolversSize * 2];
System.arraycopy(resolvers, 0, nr, 0, resolversSize);
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org