<p>George Joseph <strong>uploaded patch set #2</strong> to this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15724">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_prometheus: Clone containers before iterating<br><br>The channels, bridges and endpoints scrape functions were<br>grabbing their respective global containers, getting the<br>count of entries, allocating metric arrays based on<br>that count, then iterating over the container.  If the<br>global container had new objects added after the count<br>was taken and the metric arrays were allocated, we'd run<br>out of metric entries and attempt to write past the end<br>of the arrays.<br><br>Now each of the scape functions clone their respective<br>global containers and all operations are done on the<br>clone.  Since the clone is stable between getting the<br>count and iterating over it, we can't run past the end<br>of the metrics array.<br><br>ASTERISK-29130<br>Reported-By: Francisco Correia<br>Reported-By: BJ Weschke<br>Reported-By: Sébastien Duthil<br><br>Change-Id: If0c8e40853bc0e9429f2ba9c7f5f358d90c311af<br>---<br>M res/prometheus/bridges.c<br>M res/prometheus/channels.c<br>M res/prometheus/endpoints.c<br>3 files changed, 31 insertions(+), 5 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/24/15724/2</pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15724">change 15724</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/c/asterisk/+/15724"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18 </div>
<div style="display:none"> Gerrit-Change-Id: If0c8e40853bc0e9429f2ba9c7f5f358d90c311af </div>
<div style="display:none"> Gerrit-Change-Number: 15724 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-CC: Friendly Automation </div>
<div style="display:none"> Gerrit-MessageType: newpatchset </div>