diff --git a/common/buf/buffer.go b/common/buf/buffer.go index f716c556..4f85792e 100644 --- a/common/buf/buffer.go +++ b/common/buf/buffer.go @@ -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 }