<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11068">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_diversion: Use static pj_str_t for Diversion header names<br><br>PJSIP assumes that these header names are not allocated, and does not<br>clone the name strings when reusing headers.<br><br>Block unload of res_pjsip_diversion until shutdown to ensure static<br>memory stays valid.<br><br>ASTERISK-28312 #close<br><br>Change-Id: Ibd6ea55ec4a604bbd43ac07f8d0b54da2c39b8b9<br>---<br>M res/res_pjsip_diversion.c<br>1 file changed, 2 insertions(+), 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/68/11068/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_diversion.c b/res/res_pjsip_diversion.c</span><br><span>index e82140b..a7c31c4 100644</span><br><span>--- a/res/res_pjsip_diversion.c</span><br><span>+++ b/res/res_pjsip_diversion.c</span><br><span>@@ -325,8 +325,7 @@</span><br><span> </span><br><span> hdr = pjsip_from_hdr_create(tdata->pool);</span><br><span> hdr->type = PJSIP_H_OTHER;</span><br><span style="color: hsl(0, 100%, 40%);">- pj_strdup(tdata->pool, &hdr->name, &diversion_name);</span><br><span style="color: hsl(0, 100%, 40%);">- hdr->sname = hdr->name;</span><br><span style="color: hsl(120, 100%, 40%);">+ hdr->sname = hdr->name = diversion_name;</span><br><span> </span><br><span> name_addr = pjsip_uri_clone(tdata->pool, base);</span><br><span> uri = pjsip_uri_get_uri(name_addr->uri);</span><br><span>@@ -411,6 +410,7 @@</span><br><span> </span><br><span> static int load_module(void)</span><br><span> {</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_module_shutdown_ref(ast_module_info->self);</span><br><span> ast_sip_session_register_supplement(&diversion_supplement);</span><br><span> return AST_MODULE_LOAD_SUCCESS;</span><br><span> }</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11068">change 11068</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/+/11068"/><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: Ibd6ea55ec4a604bbd43ac07f8d0b54da2c39b8b9 </div>
<div style="display:none"> Gerrit-Change-Number: 11068 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>