This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 10.1.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push:
new 9caeac1648 Avoid very unlikely NPE
9caeac1648 is described below
commit 9caeac1648a613ec77f63702b9a4f94e4723088e
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 658ea6cafd..4d31dfe36c 100644
--- a/java/org/apache/catalina/manager/host/HostManagerServlet.java
+++ b/java/org/apache/catalina/manager/host/HostManagerServlet.java
@@ -400,6 +400,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]