tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 47216] New: Possible NPE in Http11Processor.action()
Date Tue, 19 May 2009 01:13:51 GMT
https://issues.apache.org/bugzilla/show_bug.cgi?id=47216

           Summary: Possible NPE in Http11Processor.action()
           Product: Tomcat 6
           Version: unspecified
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: dev@tomcat.apache.org
        ReportedBy: sebb@apache.org


The code at around line 1075:

        } else if (actionCode == ActionCode.ACTION_REQ_LOCAL_ADDR_ATTRIBUTE) {

            if (localAddr == null)
               localAddr = socket.getLocalAddress().getHostAddress();

fails to check if "socket != null".

Since this is checked everywhere else in the method this is probably a bug.

The method Http11Processor.parseHost() also references "socket" without
checking for null. Within the class, it is only called by process(Socket),
which guarantees that it won't be null.

However once process() returns normally, socket will be set to null.

The parseHost() method is public, so it may be called when socket == null.

Perhaps the parseHost() method should be private?

-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message