MINOR: promex: Always limit the number of labels dumped for each metric

It was not an issue since now, be a way to register modules on promex will
be added. Thus it is important to add some extra checks. Here, we take care
to never dump more than the max labels allowed.
This commit is contained in:
Christopher Faulet 2024-01-29 17:19:28 +01:00
parent 7ad9266ad8
commit 5a48a94dcc

View File

@ -536,7 +536,7 @@ static int promex_dump_metric(struct appctx *appctx, struct htx *htx, struct ist
if (istcat(out, ist("{"), max) == -1)
goto full;
for (i = 0; isttest(labels[i].name); i++) {
for (i = 0; i < PROMEX_MAX_LABELS && isttest(labels[i].name); i++) {
if (!isttest(labels[i].value))
continue;