asterisk/res/prometheus
George Joseph 53c702e1cc res_prometheus: Clone containers before iterating
The channels, bridges and endpoints scrape functions were
grabbing their respective global containers, getting the
count of entries, allocating metric arrays based on
that count, then iterating over the container.  If the
global container had new objects added after the count
was taken and the metric arrays were allocated, we'd run
out of metric entries and attempt to write past the end
of the arrays.

Now each of the scape functions clone their respective
global containers and all operations are done on the
clone.  Since the clone is stable between getting the
count and iterating over it, we can't run past the end
of the metrics array.

ASTERISK-29130
Reported-By: Francisco Correia
Reported-By: BJ Weschke
Reported-By: Sébastien Duthil

Change-Id: If0c8e40853bc0e9429f2ba9c7f5f358d90c311af
2021-04-02 07:37:41 -05:00
..
bridges.c res_prometheus: Clone containers before iterating 2021-04-02 07:37:41 -05:00
channels.c res_prometheus: Clone containers before iterating 2021-04-02 07:37:41 -05:00
cli.c res_prometheus: Add CLI commands 2019-05-22 08:24:39 -05:00
endpoints.c res_prometheus: Clone containers before iterating 2021-04-02 07:37:41 -05:00
pjsip_outbound_registrations.c res_prometheus: Add metrics for PJSIP outbound registrations 2019-05-22 08:25:19 -05:00
prometheus_internal.h res_prometheus: Add metrics for PJSIP outbound registrations 2019-05-22 08:25:19 -05:00