This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push: new 26272b8ad4 Avoid possible NPE 26272b8ad4 is described below commit 26272b8ad49763466eed67b29a6183a70114acc5 Author: remm <r...@apache.org> AuthorDate: Thu Sep 7 11:33:09 2023 +0200 Avoid possible NPE The handling of an error accessing the descriptor was inconsistent. Found by coverity. --- java/org/apache/catalina/startup/HostConfig.java | 4 ++-- webapps/docs/changelog.xml | 8 ++++++++ 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java index 7b10f5c494..a9246908c2 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -541,9 +541,9 @@ public class HostConfig implements LifecycleListener { boolean isExternal = false; File expandedDocBase = null; - try (FileInputStream fis = new FileInputStream(contextXml)) { + try { synchronized (digesterLock) { - try { + try (FileInputStream fis = new FileInputStream(contextXml)) { context = (Context) digester.parse(fis); } catch (Exception e) { log.error(sm.getString("hostConfig.deployDescriptor.error", contextXml.getAbsolutePath()), e); diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 7962aeea93..8da3c35acf 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -105,6 +105,14 @@ issues do not "pop up" wrt. others). --> <section name="Tomcat 11.0.0-M12 (markt)" rtext="in development"> + <subsection name="Catalina"> + <changelog> + <fix> + Fix handling of an error reading a context descriptor on deployment. + (remm) + </fix> + </changelog> + </subsection> </section> <section name="Tomcat 11.0.0-M11 (markt)" rtext="2023-08-25"> <subsection name="Catalina"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org