This is an automated email from the ASF dual-hosted git repository. remm 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 3189da5d00 Avoid possible NPE 3189da5d00 is described below commit 3189da5d001c1ebecea51dbb7822a482d9ecd981 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 79eb649ab1..3bc526b452 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -625,9 +625,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 3e51f63466..2770320618 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 9.0.81 (remm)" 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 9.0.80 (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