mirror of
https://github.com/prometheus/prometheus.git
synced 2025-03-05 20:59:13 -08: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)
|
b := r.b.Range(off, off+binary.MaxVarintLen32)
|
||||||
|
|
||||||
l, n := binary.Uvarint(b)
|
l, n := binary.Uvarint(b)
|
||||||
if n > binary.MaxVarintLen32 {
|
if n <= 0 || n > binary.MaxVarintLen32 {
|
||||||
return decbuf{e: errors.New("invalid uvarint")}
|
return decbuf{e: errors.Errorf("invalid uvarint %d", n)}
|
||||||
}
|
}
|
||||||
|
|
||||||
if r.b.Len() < off+n+int(l)+4 {
|
if r.b.Len() < off+n+int(l)+4 {
|
||||||
|
|
Loading…
Reference in a new issue