mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-25 18:11:27 +00:00
Fix an edge case reshaping buffer too long
This commit is contained in:
parent
f5e71b9db7
commit
291061e9da
|
@ -257,7 +257,7 @@ func ReshapeMultiBuffer(ctx context.Context, buffer buf.MultiBuffer) buf.MultiBu
|
||||||
for i, buffer1 := range buffer {
|
for i, buffer1 := range buffer {
|
||||||
if buffer1.Len() >= buf.Size-21 {
|
if buffer1.Len() >= buf.Size-21 {
|
||||||
index := int32(bytes.LastIndex(buffer1.Bytes(), TlsApplicationDataStart))
|
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
|
index = buf.Size / 2
|
||||||
}
|
}
|
||||||
buffer2 := buf.New()
|
buffer2 := buf.New()
|
||||||
|
|
Loading…
Reference in a new issue