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 2026/05/13 09:46:48 UTC

(tomcat) branch 9.0.x updated: Fix potential thread safety issue

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 3b305d07c4 Fix potential thread safety issue
3b305d07c4 is described below

commit 3b305d07c4576f6faf54ecb0a31f67b0b8952c84
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed May 13 10:46:05 2026 +0100

    Fix potential thread safety issue
---
 java/org/apache/catalina/startup/HostConfig.java | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java
index eb39c52993..0d1085be66 100644
--- a/java/org/apache/catalina/startup/HostConfig.java
+++ b/java/org/apache/catalina/startup/HostConfig.java
@@ -31,8 +31,8 @@ import java.security.PermissionCollection;
 import java.security.Policy;
 import java.security.cert.Certificate;
 import java.util.ArrayList;
+import java.util.Collections;
 import java.util.HashMap;
-import java.util.HashSet;
 import java.util.Iterator;
 import java.util.LinkedHashMap;
 import java.util.List;
@@ -167,17 +167,17 @@ public class HostConfig implements LifecycleListener {
     /**
      * The list of descriptors in the appBase to be ignored because they are invalid (e.g. contain /../ sequences).
      */
-    protected final Set<String> invalidDescriptors = new HashSet<>();
+    protected final Set<String> invalidDescriptors = Collections.newSetFromMap(new ConcurrentHashMap<>());
 
     /**
      * The list of directories in the appBase to be ignored because they are invalid (e.g. contain /../ sequences).
      */
-    protected final Set<String> invalidDirectories = new HashSet<>();
+    protected final Set<String> invalidDirectories = Collections.newSetFromMap(new ConcurrentHashMap<>());
 
     /**
      * The list of Wars in the appBase to be ignored because they are invalid (e.g. contain /../ sequences).
      */
-    protected final Set<String> invalidWars = new HashSet<>();
+    protected final Set<String> invalidWars = Collections.newSetFromMap(new ConcurrentHashMap<>());
 
     // ------------------------------------------------------------- Properties
 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org