Skip to content

Commit 291061e

Browse files
committed
Fix an edge case reshaping buffer too long
1 parent f5e71b9 commit 291061e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

proxy/proxy.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBu
257257
for i, buffer1 := range buffer {
258258
if buffer1.Len() >= buf.Size-21 {
259259
index := int32(bytes.LastIndex(buffer1.Bytes(), TlsApplicationDataStart))
260-
if index <= 0 || index > buf.Size-21 {
260+
if index < 21 || index > buf.Size-21 {
261261
index = buf.Size / 2
262262
}
263263
buffer2 := buf.New()

0 commit comments

Comments
 (0)