Julien Pivotto 7f82c5f52c textparse: fix panic in protobuf parser for summary with no quantiles
getMagicLabel had no bounds check on the quantile slice for the Summary
case. fieldsDone for an empty-quantile summary is set inside Series(),
not getMagicLabel. A caller driving Next() without calling Series() at
the _sum step would allow fieldPos to advance to 0 and index into an
empty slice.

Add the same out-of-bounds guard that the histogram branch already has,
and a regression test that exercises Next()-only iteration over a
summary with no quantiles.

Signed-off-by: Julien Pivotto <291750+roidelapluie@users.noreply.github.com>
2026-03-27 10:37:32 +01:00
..
2025-11-05 13:47:34 +01:00

Making changes to textparse lexers

In the rare case that you need to update the textparse lexers, edit promlex.l or openmetricslex.l and then run the following command: golex -o=promlex.l.go promlex.l

Note that you need golex installed: go get -u modernc.org/golex