This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/8.5.x by this push:
new b8f935815b Avoid possible NPE
b8f935815b is described below
commit b8f935815b88a8c8afc77e7e77291bbc1c3f38d9
Author: remm <[email protected]>
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 eb70708349..56b8c17570 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 ae55fbbf45..0d08a0b809 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 8.5.94 (schultz)" 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 8.5.93 (markt)" rtext="2023-08-25">
<subsection name="Catalina">
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]