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 203dc0a Avoid NPE on some failed resolutions
203dc0a is described below
commit 203dc0ab6637d4f16b0bf03ebbd871b8b164a511
Author: remm <[email protected]>
AuthorDate: Tue Mar 16 15:59:23 2021 +0100
Avoid NPE on some failed resolutions
In some cases, the factory returns null, so treat it as a usual naming
failure.
---
java/org/apache/naming/NamingContext.java | 3 +++
webapps/docs/changelog.xml | 8 ++++++++
2 files changed, 11 insertions(+)
diff --git a/java/org/apache/naming/NamingContext.java
b/java/org/apache/naming/NamingContext.java
index e1ddeff..67d6284 100644
--- a/java/org/apache/naming/NamingContext.java
+++ b/java/org/apache/naming/NamingContext.java
@@ -873,6 +873,9 @@ public class NamingContext implements Context {
entry.value = obj;
}
}
+ if (obj == null) {
+ throw new
NamingException(sm.getString("namingContext.failResolvingReference"));
+ }
return obj;
} catch (NamingException e) {
throw e;
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 9ae4b82..777f9f8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -104,6 +104,14 @@
issues do not "pop up" wrt. others).
-->
<section name="Tomcat 9.0.45 (markt)" rtext="in development">
+ <subsection name="Catalina">
+ <changelog>
+ <fix>
+ Avoid NPE when a JNDI reference cannot be resolved in favor of a
+ NamingException. (remm)
+ </fix>
+ </changelog>
+ </subsection>
<subsection name="Coyote">
<changelog>
<fix>
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]