This is an automated email from the ASF dual-hosted git repository.
remm pushed a commit to branch 9.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/9.0.x by this push:
new c068b17d7c Check read return value
c068b17d7c is described below
commit c068b17d7c53e1713956917f603e6adb1c208dbb
Author: remm <[email protected]>
AuthorDate: Tue Sep 19 15:10:30 2023 +0200
Check read return value
Although "not needed" technically, it is a lot clearer to simply check
it as usual and the exit from processing is a lot faster.
Found by coverity.
---
java/org/apache/tomcat/util/net/SecureNioChannel.java | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/java/org/apache/tomcat/util/net/SecureNioChannel.java
b/java/org/apache/tomcat/util/net/SecureNioChannel.java
index 4b49792fce..dc001e62b8 100644
--- a/java/org/apache/tomcat/util/net/SecureNioChannel.java
+++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java
@@ -265,7 +265,9 @@ public class SecureNioChannel extends NioChannel {
Integer.toString(newLimit)));
netInBuffer = ByteBufferUtils.expand(netInBuffer, newLimit);
- sc.read(netInBuffer);
+ if (sc.read(netInBuffer) < 0) {
+ return -1;
+ }
extractor = new TLSClientHelloExtractor(netInBuffer);
}
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]