You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/03/09 09:25:18 UTC
[tomcat] branch 10.0.x updated: Fix NPE if exception occurs during destruction of Servlet - BZ 65940
This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new b555cc0 Fix NPE if exception occurs during destruction of Servlet - BZ 65940
b555cc0 is described below
commit b555cc0cac22ef095f34609946fd44ca92f968bf
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Wed Mar 9 09:22:34 2022 +0000
Fix NPE if exception occurs during destruction of Servlet - BZ 65940
https://bz.apache.org/bugzilla/show_bug.cgi?id=65940
Also includes a trivial optimisation
---
java/org/apache/catalina/core/StandardWrapper.java | 4 ++--
webapps/docs/changelog.xml | 4 ++++
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/java/org/apache/catalina/core/StandardWrapper.java b/java/org/apache/catalina/core/StandardWrapper.java
index f40f487..c9d6071 100644
--- a/java/org/apache/catalina/core/StandardWrapper.java
+++ b/java/org/apache/catalina/core/StandardWrapper.java
@@ -1329,7 +1329,6 @@ public class StandardWrapper extends ContainerBase
} catch (Throwable t) {
t = ExceptionUtils.unwrapInvocationTargetException(t);
ExceptionUtils.handleThrowable(t);
- instance = null;
instancePool = null;
nInstances = 0;
fireContainerEvent("unload", this);
@@ -1358,12 +1357,13 @@ public class StandardWrapper extends ContainerBase
}
}
}
+ instance = null;
+ instanceInitialized = false;
}
}
// Deregister the destroyed instance
instance = null;
- instanceInitialized = false;
if (isJspServlet && jspMonitorON != null ) {
Registry.getRegistry(null, null).unregisterComponent(jspMonitorON);
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 2a1c8f5..3fff64f 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -122,6 +122,10 @@
original request cannot be mapped to a context. This typically happens
when no ROOT context is defined. Pull request by elkman. (markt)
</fix>
+ <fix>
+ <bug>65940</bug>: Fix <code>NullPointerException</code> if an exception
+ occurs during the destruction of a Servlet. (markt)
+ </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