mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-11-26 02:21:27 +00:00
Fix padding extends out of bound
This commit is contained in:
parent
43bc929030
commit
7b54255cc1
|
@ -556,6 +556,9 @@ func XtlsPadding(b *buf.Buffer, command byte, userUUID *[]byte, longPadding bool
|
||||||
b.Release()
|
b.Release()
|
||||||
b = nil
|
b = nil
|
||||||
}
|
}
|
||||||
|
if paddingLen > buf.Size - newbuffer.Len() {
|
||||||
|
paddingLen = buf.Size - newbuffer.Len()
|
||||||
|
}
|
||||||
newbuffer.Extend(paddingLen)
|
newbuffer.Extend(paddingLen)
|
||||||
newError("XtlsPadding ", contantLen, " ", paddingLen, " ", command).WriteToLog(session.ExportIDToError(ctx))
|
newError("XtlsPadding ", contantLen, " ", paddingLen, " ", command).WriteToLog(session.ExportIDToError(ctx))
|
||||||
return newbuffer
|
return newbuffer
|
||||||
|
|
Loading…
Reference in a new issue