mirror of
https://github.com/prometheus/prometheus
synced 2025-01-14 10:52:10 +00:00
index: fix another Uvarint() return check
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
This commit is contained in:
parent
ee5fe8ea9f
commit
e8fc6c8774
@ -740,8 +740,8 @@ func (r *Reader) decbufUvarintAt(off int) decbuf {
|
||||
b := r.b.Range(off, off+binary.MaxVarintLen32)
|
||||
|
||||
l, n := binary.Uvarint(b)
|
||||
if n > binary.MaxVarintLen32 {
|
||||
return decbuf{e: errors.New("invalid uvarint")}
|
||||
if n <= 0 || n > binary.MaxVarintLen32 {
|
||||
return decbuf{e: errors.Errorf("invalid uvarint %d", n)}
|
||||
}
|
||||
|
||||
if r.b.Len() < off+n+int(l)+4 {
|
||||
|
Loading…
Reference in New Issue
Block a user