mirror of
https://github.com/v2fly/v2ray-core.git
synced 2024-12-22 10:08:15 -05:00
check size in Reset
This commit is contained in:
parent
1be86e6e3a
commit
b3b0649dd6
@ -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
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user