mirror of
https://github.com/prometheus/prometheus.git
synced 2026-04-04 05:11:03 +02:00
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>
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