You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2022/09/01 12:51:23 UTC

[tomcat] branch 8.5.x updated: Avoid NPE (observed in NIO2 tests)

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

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new e886ee2018 Avoid NPE (observed in NIO2 tests)
e886ee2018 is described below

commit e886ee20183b5f5d2a902843b6d324b58d991ea8
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Thu Sep 1 13:50:53 2022 +0100

    Avoid NPE (observed in NIO2 tests)
---
 java/org/apache/coyote/http11/filters/BufferedInputFilter.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/coyote/http11/filters/BufferedInputFilter.java b/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
index 04b5b53be3..34321b351a 100644
--- a/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
+++ b/java/org/apache/coyote/http11/filters/BufferedInputFilter.java
@@ -137,7 +137,7 @@ public class BufferedInputFilter implements InputFilter, ApplicationBufferHandle
     @Override
     public void recycle() {
         if (buffered != null) {
-            if (buffered.getBuffer().length > 65536) {
+            if (buffered.getBuffer() != null && buffered.getBuffer().length > 65536) {
                 buffered = null;
             } else {
                 buffered.recycle();


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