mirror of
https://github.com/prometheus/prometheus.git
synced 2026-04-02 12:22:06 +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>