1
0
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:
Darien Raymond 2018-09-01 21:19:15 +02:00
parent 1be86e6e3a
commit b3b0649dd6
No known key found for this signature in database
GPG Key ID: 7251FFA14BB18169

View File

@ -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
}