mirror of
https://github.com/v2fly/v2ray-core.git
synced 2026-10-07 19:23:48 -07:00
check size in Reset
This commit is contained in:
@@ -67,6 +67,9 @@ func (b *Buffer) Reset(writer Supplier) error {
|
||||
nBytes, err := writer(b.v)
|
||||
b.start = 0
|
||||
b.end = int32(nBytes)
|
||||
if b.end > int32(len(b.v)) {
|
||||
b.end = int32(len(b.v))
|
||||
}
|
||||
return err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user