tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
Subject DO NOT REPLY [Bug 47216] New: Possible NPE in Http11Processor.action()
Date Tue, 19 May 2009 01:13:51 GMT

           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

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:
------- You are receiving this mail because: -------
You are the assignee for the bug.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message