<p>Kevin Harwell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18273">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_header_funcs: wrong pool used tdata headers<br><br>When adding headers to an outgoing request the headers were cloned using<br>the dialog's pool when they should have been cloned using tdata's pool.<br>Under certain circumstances it's was possible for the dialog object, and<br>its pool to be freed while tdata is still active and available. Thus the<br>cloned header "disappeared", and when tdata tried to later access it a<br>crash would occur.<br><br>This patch makes it so all added headers are cloned appropriately using<br>tdata's pool.<br><br>ASTERISK-29411 #close<br>ASTERISK-29535 #close<br><br>Change-Id: I9852025b5ee93ce1c038209150ee9dba1e0767c5<br>---<br>M res/res_pjsip_header_funcs.c<br>1 file changed, 1 insertion(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/73/18273/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_header_funcs.c b/res/res_pjsip_header_funcs.c</span><br><span>index ac3bea4..794b5e8 100644</span><br><span>--- a/res/res_pjsip_header_funcs.c</span><br><span>+++ b/res/res_pjsip_header_funcs.c</span><br><span>@@ -747,7 +747,6 @@</span><br><span>  */</span><br><span> static void outgoing_request(struct ast_sip_session *session, pjsip_tx_data * tdata)</span><br><span> {</span><br><span style="color: hsl(0, 100%, 40%);">-   pj_pool_t *pool = session->inv_session->dlg->pool;</span><br><span>  struct hdr_list *list;</span><br><span>       struct hdr_list_entry *le;</span><br><span>   RAII_VAR(struct ast_datastore *, datastore,</span><br><span>@@ -760,7 +759,7 @@</span><br><span> </span><br><span>        list = datastore->data;</span><br><span>   AST_LIST_TRAVERSE(list, le, nextptr) {</span><br><span style="color: hsl(0, 100%, 40%);">-          pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) pjsip_hdr_clone(pool, le->hdr));</span><br><span style="color: hsl(120, 100%, 40%);">+            pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr *) pjsip_hdr_clone(tdata->pool, le->hdr));</span><br><span>         }</span><br><span>    ast_sip_session_remove_datastore(session, datastore->uid);</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18273">change 18273</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/+/18273"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 19 </div>
<div style="display:none"> Gerrit-Change-Id: I9852025b5ee93ce1c038209150ee9dba1e0767c5 </div>
<div style="display:none"> Gerrit-Change-Number: 18273 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>