<p>Gergely Dömsödi has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11098">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_queue: fix ring_entry to access nativeformats with a channel lock<br><br>Fixes an intermittent segmentation fault which occured when accessing<br>nativeformats of a channel which entered into a queue.<br><br>ASTERISK-27964<br>Reported by: Francisco Seratti<br><br>Change-Id: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e<br>---<br>M apps/app_queue.c<br>1 file changed, 7 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/98/11098/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/apps/app_queue.c b/apps/app_queue.c</span><br><span>index f441e35..132621d 100644</span><br><span>--- a/apps/app_queue.c</span><br><span>+++ b/apps/app_queue.c</span><br><span>@@ -4497,6 +4497,7 @@</span><br><span> char tech[256];</span><br><span> char *location;</span><br><span> const char *macrocontext, *macroexten;</span><br><span style="color: hsl(120, 100%, 40%);">+ struct ast_format_cap *nativeformats;</span><br><span> RAII_VAR(struct ast_json *, blob, NULL, ast_json_unref);</span><br><span> </span><br><span> /* on entry here, we know that tmp->chan == NULL */</span><br><span>@@ -4513,8 +4514,13 @@</span><br><span> location = "";</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_lock(qe->chan);</span><br><span style="color: hsl(120, 100%, 40%);">+ nativeformats = ao2_bump(ast_channel_nativeformats(qe->chan));</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_channel_unlock(qe->chan);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /* Request the peer */</span><br><span style="color: hsl(0, 100%, 40%);">- tmp->chan = ast_request(tech, ast_channel_nativeformats(qe->chan), NULL, qe->chan, location, &status);</span><br><span style="color: hsl(120, 100%, 40%);">+ tmp->chan = ast_request(tech, nativeformats, NULL, qe->chan, location, &status);</span><br><span style="color: hsl(120, 100%, 40%);">+ ao2_cleanup(nativeformats);</span><br><span> if (!tmp->chan) { /* If we can't, just go on to the next call */</span><br><span> ao2_lock(qe->parent);</span><br><span> qe->parent->rrpos++;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11098">change 11098</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/+/11098"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: Ic87fa7a363f3b487c24ce07032f4b2201c22db9e </div>
<div style="display:none"> Gerrit-Change-Number: 11098 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Gergely Dömsödi <doome@uhusystems.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>