On 21/09/2023 10:36, r...@apache.org wrote:
This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/main by this push:
new f189ef5992 Avoid unlikely NPEs and add localization
f189ef5992 is described below
commit f189ef599253c6e90bc7d4189a21a9eb85020239
Author: remm <r...@apache.org>
AuthorDate: Thu Sep 21 11:35:40 2023 +0200
Avoid unlikely NPEs and add localization
Found by coverity.
<snip/>
diff --git a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
index d061dc36a2..a503b1dac0 100644
--- a/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
+++ b/java/org/apache/jasper/runtime/JspRuntimeLibrary.java
@@ -990,9 +990,10 @@ public class JspRuntimeLibrary {
String resourcePath = getContextRelativePath(request, relativePath);
RequestDispatcher rd = request.getRequestDispatcher(resourcePath);
-
- rd.include(request,
- new ServletResponseWrapperInclude(response, out));
+ if (rd != null) {
+ rd.include(request,
+ new ServletResponseWrapperInclude(response, out));
+ }
Do we want a silent failure here? While am IOException or
ServletException would be ideal, I think an NPE was better than nothing.
Mark
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org
For additional commands, e-mail: dev-h...@tomcat.apache.org