Bug 61777 - NPE in AuthConfigFactoryImpl.detachListener()
Summary: NPE in AuthConfigFactoryImpl.detachListener()
Alias: None
Product: Tomcat 8
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 8.5.x-trunk
Hardware: PC All
: P2 normal (vote)
Target Milestone: ----
Assignee: Tomcat Developers Mailing List
Depends on:
Reported: 2017-11-18 13:44 UTC by Lazar Kirchev
Modified: 2017-11-20 11:54 UTC (History)
0 users


Note You need to log in before you can comment on or make changes to this bug.
Description Lazar Kirchev 2017-11-18 13:44:49 UTC
In case AuthConfigFactoryImpl.detachListener() is called for a combination of layer and appContext for which there is no registration (e.g. because the registration was already removed, or due to wrong layer and/or appContext) the method throws a NPE.

It does not check for null the result from the call to findRegistrationContextImpl, which is null if such registration does not exist.
Comment 1 Lazar Kirchev 2017-11-18 13:48:14 UTC
This pull request contains a test case, which illustrates the problem and a fix for it: https://github.com/apache/tomcat/pull/85
Comment 2 Mark Thomas 2017-11-20 11:54:45 UTC
Thanks for the patch and bonus points for including a test case.

Fixed in:
- trunk for 9.0.2 onwards
- 8.5.x for 8.5.24 onwards