This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new 0c4bab40a0 Check read return value 0c4bab40a0 is described below commit 0c4bab40a06a2a58d509c40989d03ad801e3f4a5 Author: remm <r...@apache.org> 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 74bb9c25d5..beac2d62e3 100644 --- a/java/org/apache/tomcat/util/net/SecureNioChannel.java +++ b/java/org/apache/tomcat/util/net/SecureNioChannel.java @@ -263,7 +263,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: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org