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 2020/10/16 13:30:02 UTC

[tomcat] 01/03: SpotBugs - Fix possible NPE

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

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

commit 9ead1c192007318c7d9deb78d01f7eac5e801e3e
Author: Mark Thomas <ma...@apache.org>
AuthorDate: Fri Oct 16 14:21:52 2020 +0100

    SpotBugs - Fix possible NPE
---
 java/org/apache/catalina/ha/backend/TcpSender.java | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/java/org/apache/catalina/ha/backend/TcpSender.java b/java/org/apache/catalina/ha/backend/TcpSender.java
index 5676c88..7e1bda9 100644
--- a/java/org/apache/catalina/ha/backend/TcpSender.java
+++ b/java/org/apache/catalina/ha/backend/TcpSender.java
@@ -151,7 +151,7 @@ public class TcpSender
                 // read all the headers.
                 String header = connectionReaders[i].readLine();
                 int contentLength = 0;
-                while (!header.isEmpty()) {
+                while (header != null && !header.isEmpty()) {
                     int colon = header.indexOf(':');
                     String headerName = header.substring(0, colon).trim();
                     String headerValue = header.substring(colon + 1).trim();


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