Bug 39255 - NullPointerException thrown in AuthenticatorBase.register method
Summary: NullPointerException thrown in AuthenticatorBase.register method
Status: RESOLVED FIXED
Alias: None
Product: Tomcat 5
Classification: Unclassified
Component: Catalina (show other bugs)
Version: 5.5.16
Hardware: All All
: P2 normal (vote)
Target Milestone: ---
Assignee: Tomcat Developers Mailing List
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2006-04-09 15:52 UTC by Abdessattar Sassi
Modified: 2006-12-26 16:56 UTC (History)
0 users



Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Abdessattar Sassi 2006-04-09 15:52:51 UTC
In org.apache.catalina.authenticator.AuthenticatorBase.register
(AuthenticatorBase.java:706) a DEBUG log causes a NullPointerException to be 
thrown if the principal object passed to the method is null, for example when 
a previously logged in principal is being logged out.


    protected void register(Request request, Response response,
                            Principal principal, String authType,
                            String username, String password) {

        if (log.isDebugEnabled())
            log.debug("Authenticated '" + principal.getName() + "' with type '"
                + authType + "'");

The acces principal.getName() when principal is null causes an exception. 

Note that is DEBUG traces are not enabled, the processing continues as 
expected.
Comment 1 Yoav Shapira 2006-04-14 18:43:30 UTC
Mmm, I wish I saw this before cutting 5.5.17 just now.  Will do for the
following release.
Comment 2 Yoav Shapira 2006-12-26 16:56:37 UTC
Jees, I let this one slip a long time, didn't I?  Sorry about that, and thanks
again for reporting the bug originally.  The fix has been committed to SVN.