You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by re...@apache.org on 2019/05/09 16:39:12 UTC

[tomcat] branch master updated: Avoid possible NPE on commit

This is an automated email from the ASF dual-hosted git repository.

remm pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/master by this push:
     new 659b28c  Avoid possible NPE on commit
659b28c is described below

commit 659b28c00d94e2a9049e0a8ac1e02bd4d36dd005
Author: remm <re...@apache.org>
AuthorDate: Thu May 9 18:38:59 2019 +0200

    Avoid possible NPE on commit
---
 java/org/apache/coyote/http11/Http11OutputBuffer.java | 5 ++++-
 webapps/docs/changelog.xml                            | 4 ++++
 2 files changed, 8 insertions(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http11/Http11OutputBuffer.java b/java/org/apache/coyote/http11/Http11OutputBuffer.java
index aa5ad48..62d5223 100644
--- a/java/org/apache/coyote/http11/Http11OutputBuffer.java
+++ b/java/org/apache/coyote/http11/Http11OutputBuffer.java
@@ -303,7 +303,10 @@ public class Http11OutputBuffer implements HttpOutputBuffer {
             // Sending the response header buffer
             headerBuffer.flip();
             try {
-                socketWrapper.write(isBlocking(), headerBuffer);
+                SocketWrapperBase<?> socketWrapper = this.socketWrapper;
+                if (socketWrapper != null) {
+                    socketWrapper.write(isBlocking(), headerBuffer);
+                }
             } finally {
                 headerBuffer.position(0).limit(headerBuffer.capacity());
             }
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index f05b40d..a115137 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -75,6 +75,10 @@
         was the only other sensible value, but without and impact beyond
         certain microbenchmarks. (remm)
       </fix>
+      <fix>
+        Avoid possible NPE in <code>Http11OutputBuffer.commit</code> on
+        connector stopclose. (remm)
+      </fix>
     </changelog>
   </subsection>
   <subsection name="Other">


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