Skip to content

Commit

Permalink
[UNDERTOW-2429] CVE-2024-7885 Fix ProxyProtocolReadListener leak betw…
Browse files Browse the repository at this point in the history
…een multiple threads

Signed-off-by: Flavia Rainone <[email protected]>
  • Loading branch information
baranowb authored and fl4via committed Sep 1, 2024
1 parent a94fa0e commit ce5182c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class ProxyProtocolReadListener implements ChannelListener<StreamSourceChannel>
private InetAddress destAddress;
private int sourcePort = -1;
private int destPort = -1;
private StringBuilder stringBuilder = new StringBuilder();
private boolean carriageReturnSeen = false;
private boolean parsingUnknown = false;

Expand Down Expand Up @@ -223,6 +222,7 @@ private void parseProxyProtocolV2(PooledByteBuffer buffer, AtomicBoolean freeBuf
}

private void parseProxyProtocolV1(PooledByteBuffer buffer, AtomicBoolean freeBuffer) throws Exception {
final StringBuilder stringBuilder = new StringBuilder();
while (buffer.getBuffer().hasRemaining()) {
char c = (char) buffer.getBuffer().get();
if (byteCount < NAME.length) {
Expand Down

0 comments on commit ce5182c

Please sign in to comment.