You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2024/10/10 13:52:54 UTC
(tomcat) branch 9.0.x updated: Avoid possible NPE
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 d597dd0ef1 Avoid possible NPE
d597dd0ef1 is described below
commit d597dd0ef1e2ee5a3902acded19f4abfa0b1b201
Author: remm <re...@apache.org>
AuthorDate: Thu Oct 10 15:50:10 2024 +0200
Avoid possible NPE
---
java/org/apache/catalina/valves/CrawlerSessionManagerValve.java | 6 ++++++
webapps/docs/changelog.xml | 4 ++++
2 files changed, 10 insertions(+)
diff --git a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
index 954082fe2f..c06fcef87f 100644
--- a/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
+++ b/java/org/apache/catalina/valves/CrawlerSessionManagerValve.java
@@ -175,6 +175,12 @@ public class CrawlerSessionManagerValve extends ValveBase {
@Override
public void invoke(Request request, Response response) throws IOException, ServletException {
+ if (request.getHost() == null || request.getContext() == null) {
+ // Request will have no session
+ getNext().invoke(request, response);
+ return;
+ }
+
boolean isBot = false;
String sessionId = null;
String clientIp = request.getRemoteAddr();
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 28eedd19a2..4c44c177a4 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -127,6 +127,10 @@
<bug>69370</bug>: <code>DefaultServlet</code>'s HTML listing
uses incorrect labels. (michaelo)
</update>
+ <fix>
+ Avoid NPE in <code>CrawlerSessionManagerValve</code> for partially
+ mapped requests. (remm)
+ </fix>
</changelog>
</subsection>
<subsection name="Coyote">
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org