GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Auto-port 4.1: SslHandler: Fix possible buffer leak when an OOME is t… · lltopk/netty@f0b0358

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • handler/src/main/java/io/netty/handler/ssl
    • SslHandler.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎handler/src/main/java/io/netty/handler/ssl/SslHandler.java‎

Copy file name to clipboardExpand all lines: handler/src/main/java/io/netty/handler/ssl/SslHandler.java
+6-6Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -849,7 +849,7 @@ private void wrap(ChannelHandlerContext ctx, boolean inUnwrap) throws SSLExcepti
849849
break;
850850
}
851851

852-
SSLEngineResult result;
852+
SSLEngineResult result = null;
853853

854854
try {
855855
if (buf.readableBytes() > MAX_PLAINTEXT_LENGTH) {
@@ -874,16 +874,16 @@ private void wrap(ChannelHandlerContext ctx, boolean inUnwrap) throws SSLExcepti
874874
}
875875
result = wrap(alloc, engine, buf, out);
876876
}
877-
} catch (SSLException e) {
878-
// Either wrapMultiple(...) or wrap(...) did throw. In this case we need to release the buffer
879-
// that we removed from pendingUnencryptedWrites before failing the promise and rethrowing it.
880-
// Failing to do so would result in a buffer leak.
877+
} catch (Throwable e) {
878+
// Either wrapMultiple(...), wrap(...) or allocateOutNetBuf(...) did throw.
879+
// In this case we need to release the buffer that we removed from pendingUnencryptedWrites
880+
// before failing the promise and rethrowing it. Failing to do so would result in a buffer leak.
881881
// See https://github.com/netty/netty/issues/14644
882882
//
883883
// We don't need to release out here as this is done in a finally block already.
884884
buf.release();
885885
promise.setFailure(e);
886-
throw e;
886+
PlatformDependent.throwException(e);
887887
}
888888

889889
if (buf.isReadable()) {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.