Pranav904 opened a new pull request, #1157: URL: https://github.com/apache/tomcat/pull/1157
Fixes https://bz.apache.org/bugzilla/show_bug.cgi?id=70311 `SecureNioChannel.read(ByteBuffer)` loops forever when `unwrap()` returns `BUFFER_OVERFLOW`, consumes nothing, and `expand()` adds no free space to the destination buffer. The vectored overload already guards this case with a `resized` check. This adds the equivalent check to the single buffer read. The read fails with `IOException` only when `unwrap()` consumed nothing and the free space did not grow, so the OpenSSL recovery path, which consumes input on overflow, is unchanged. Tests: `TestSecureNioChannelOverflow` writes one TLS record straight into `netInBuffer`, with no socket I/O. The three overflow tests time out without the fix and pass with it. The two guard tests pass both ways. The existing `util/net` and `coyote/http11` tests give the same results with and without the change. The same fix for the NIO2 reads on 9.0.x, 10.1.x and 11.0.x is attached to the bug as `0001-overflow-fix-9.0.x-10.1.x-11.0.x.patch`. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
