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 34af21daff Avoid very unlikely NPE
34af21daff is described below
commit 34af21daffea0cc4e2c03192a9ddabbc2ed52660
Author: remm <[email protected]>
AuthorDate: Fri Sep 8 15:04:23 2023 +0200
Avoid very unlikely NPE
The source file is present in the host-manager webapp, so it would have
to be removed by the user for this to happen.
Found by coverity.
---
java/org/apache/catalina/manager/host/HostManagerServlet.java | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/java/org/apache/catalina/manager/host/HostManagerServlet.java
b/java/org/apache/catalina/manager/host/HostManagerServlet.java
index 956091e555..e8c1d6b698 100644
--- a/java/org/apache/catalina/manager/host/HostManagerServlet.java
+++ b/java/org/apache/catalina/manager/host/HostManagerServlet.java
@@ -399,6 +399,10 @@ public class HostManagerServlet
return;
}
try (InputStream is =
getServletContext().getResourceAsStream("/WEB-INF/manager.xml")) {
+ if (is == null) {
+
writer.println(smClient.getString("hostManagerServlet.managerXml"));
+ return;
+ }
Path dest = (new File(configBaseFile, "manager.xml")).toPath();
Files.copy(is, dest);
} catch (IOException e) {
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]