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 8db364ff75 Avoid very unlikely NPE
8db364ff75 is described below
commit 8db364ff75018488472f924ee1990475d1779872
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 d0c9c22836..3b88f3ebda 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]