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

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


The following commit(s) were added to refs/heads/11.0.x by this push:
     new b1be141134 Avoid possible NPEs
b1be141134 is described below

commit b1be141134a3aff659d6604e6bbf4415e9e7e076
Author: remm <[email protected]>
AuthorDate: Fri May 15 15:39:05 2026 +0200

    Avoid possible NPEs
---
 .../apache/tomcat/util/net/SocketProperties.java   | 24 +++++++++++-----------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/java/org/apache/tomcat/util/net/SocketProperties.java 
b/java/org/apache/tomcat/util/net/SocketProperties.java
index 696c53d0e9..2524625d70 100644
--- a/java/org/apache/tomcat/util/net/SocketProperties.java
+++ b/java/org/apache/tomcat/util/net/SocketProperties.java
@@ -307,7 +307,7 @@ public class SocketProperties {
      * @return the OOBINLINE value
      */
     public boolean getOoBInline() {
-        return ooBInline.booleanValue();
+        return ooBInline == null ? false : ooBInline.booleanValue();
     }
 
     /**
@@ -315,7 +315,7 @@ public class SocketProperties {
      * @return the bandwidth preference value
      */
     public int getPerformanceBandwidth() {
-        return performanceBandwidth.intValue();
+        return performanceBandwidth == null ? 0 : 
performanceBandwidth.intValue();
     }
 
     /**
@@ -323,7 +323,7 @@ public class SocketProperties {
      * @return the connection time preference value
      */
     public int getPerformanceConnectionTime() {
-        return performanceConnectionTime.intValue();
+        return performanceConnectionTime == null ? 0 : 
performanceConnectionTime.intValue();
     }
 
     /**
@@ -331,7 +331,7 @@ public class SocketProperties {
      * @return the latency preference value
      */
     public int getPerformanceLatency() {
-        return performanceLatency.intValue();
+        return performanceLatency == null ? 0 : performanceLatency.intValue();
     }
 
     /**
@@ -339,7 +339,7 @@ public class SocketProperties {
      * @return the receive buffer size
      */
     public int getRxBufSize() {
-        return rxBufSize.intValue();
+        return rxBufSize == null ? 0 : rxBufSize.intValue();
     }
 
     /**
@@ -347,7 +347,7 @@ public class SocketProperties {
      * @return the keep-alive value
      */
     public boolean getSoKeepAlive() {
-        return soKeepAlive.booleanValue();
+        return soKeepAlive == null ? false : soKeepAlive.booleanValue();
     }
 
     /**
@@ -355,7 +355,7 @@ public class SocketProperties {
      * @return {@code true} if SO_LINGER is enabled
      */
     public boolean getSoLingerOn() {
-        return soLingerOn.booleanValue();
+        return soLingerOn == null ? false : soLingerOn.booleanValue();
     }
 
     /**
@@ -363,7 +363,7 @@ public class SocketProperties {
      * @return the linger timeout value
      */
     public int getSoLingerTime() {
-        return soLingerTime.intValue();
+        return soLingerTime == null ? 0 : soLingerTime.intValue();
     }
 
     /**
@@ -371,7 +371,7 @@ public class SocketProperties {
      * @return the reuse address value
      */
     public boolean getSoReuseAddress() {
-        return soReuseAddress.booleanValue();
+        return soReuseAddress == null ? false : soReuseAddress.booleanValue();
     }
 
     /**
@@ -379,7 +379,7 @@ public class SocketProperties {
      * @return the socket timeout value
      */
     public int getSoTimeout() {
-        return soTimeout.intValue();
+        return soTimeout == null ? 0 : soTimeout.intValue();
     }
 
     /**
@@ -387,7 +387,7 @@ public class SocketProperties {
      * @return the TCP no delay value
      */
     public boolean getTcpNoDelay() {
-        return tcpNoDelay.booleanValue();
+        return tcpNoDelay == null ? false : tcpNoDelay.booleanValue();
     }
 
     /**
@@ -395,7 +395,7 @@ public class SocketProperties {
      * @return the send buffer size
      */
     public int getTxBufSize() {
-        return txBufSize.intValue();
+        return txBufSize == null ? 0 : txBufSize.intValue();
     }
 
     /**


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to