<p>Friendly Automation <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/13344">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve
Benjamin Keith Ford: Looks good to me, but someone else must approve
Kevin Harwell: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_session.c: Prevent use-after-free with TEST_FRAMEWORK enabled<br><br>We need to copy the endpoint name before we call ao2_cleanup() on it,<br>otherwise we might try to access memory that has been reclaimed.<br><br>ASTERISK-28445 #close<br>Reported by: Bernhard Schmidt<br><br>Change-Id: I404b952608aa606e0babd3c4108346721fb726b3<br>---<br>M res/res_pjsip_session.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c</span><br><span>index 12cf41d..bbdb8d1 100644</span><br><span>--- a/res/res_pjsip_session.c</span><br><span>+++ b/res/res_pjsip_session.c</span><br><span>@@ -1315,8 +1315,10 @@</span><br><span> struct ast_sip_session *session = obj;</span><br><span> struct ast_sip_session_supplement *supplement;</span><br><span> struct ast_sip_session_delayed_request *delay;</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ /* We dup the endpoint ID in case the endpoint gets freed out from under us */</span><br><span> const char *endpoint_name = session->endpoint ?</span><br><span style="color: hsl(0, 100%, 40%);">- ast_sorcery_object_get_id(session->endpoint) : "<none>";</span><br><span style="color: hsl(120, 100%, 40%);">+ ast_strdupa(ast_sorcery_object_get_id(session->endpoint)) : "<none>";</span><br><span> </span><br><span> ast_debug(3, "Destroying SIP session with endpoint %s\n", endpoint_name);</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/13344">change 13344</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/+/13344"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-Change-Id: I404b952608aa606e0babd3c4108346721fb726b3 </div>
<div style="display:none"> Gerrit-Change-Number: 13344 </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-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>