forked from asterisk/asterisk
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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
- Loading branch information
Showing
3 changed files
with
31 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters