Skip to content

Commit

Permalink
Fix an edge case reshaping buffer too long
Browse files Browse the repository at this point in the history
  • Loading branch information
yuhan6665 committed Oct 21, 2023
1 parent f5e71b9 commit 291061e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion proxy/proxy.go
Expand Up @@ -257,7 +257,7 @@ func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBu
for i, buffer1 := range buffer {
if buffer1.Len() >= buf.Size-21 {
index := int32(bytes.LastIndex(buffer1.Bytes(), TlsApplicationDataStart))
if index <= 0 || index > buf.Size-21 {
if index < 21 || index > buf.Size-21 {
index = buf.Size / 2
}
buffer2 := buf.New()
Expand Down

0 comments on commit 291061e

Please sign in to comment.