Skip to content

Commit

Permalink
Socket has been closed, return false so an attempt is not made to re-…
Browse files Browse the repository at this point in the history
…use the socket

Part of the fix for CVE-2011-2526

git-svn-id: https://svn.apache.org/repos/asf/tomcat/trunk@1145571 13f79535-47bb-0310-9956-ffa450edef68
  • Loading branch information
markt-asf committed Jul 12, 2011
1 parent 163e03c commit 48dded4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions java/org/apache/tomcat/util/net/NioEndpoint.java
Expand Up @@ -1271,6 +1271,7 @@ public boolean processSendfile(SelectionKey sk, KeyAttachment attachment, boolea
log.debug("Send file connection is being closed");
}
cancelledKey(sk,SocketStatus.STOP,false);
return false;
}
} else if ( attachment.interestOps() == 0 && reg ) {
if (log.isDebugEnabled()) {
Expand Down
4 changes: 4 additions & 0 deletions webapps/docs/changelog.xml
Expand Up @@ -124,6 +124,10 @@
Protect against infinite loops in the HTTP NIO connector if sendfile is
configured to send more data than is available in the file. (markt)
</fix>
<fix>
Prevent NPEs when a socket is closed in non-error conditions after
sendfile processing when using the HTTP NIO connector. (markt)
</fix>
</changelog>
</subsection>
<subsection name="Cluster">
Expand Down

0 comments on commit 48dded4

Please sign in to comment.