Skip to content

Commit 4383ca8

Browse files
committed
decode_prometheus: reject empty histogram le values
1 parent 6dab308 commit 4383ca8

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

src/cmt_decode_prometheus.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,8 @@ static int add_metric_histogram(struct cmt_decode_prometheus_context *context)
543543
/* probably last bucket, which has "Inf" */
544544
break;
545545
}
546-
if (!sample->label_values[le_label_index]) {
546+
if (!sample->label_values[le_label_index] ||
547+
sample->label_values[le_label_index][0] == '\0') {
547548
ret = report_error(context,
548549
CMT_DECODE_PROMETHEUS_SYNTAX_ERROR,
549550
"missing histogram bucket \"le\" value");

0 commit comments

Comments
 (0)