<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7048">View Change</a></p><div style="white-space:pre-wrap">Approvals:
George Joseph: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
Richard Mudgett: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_ari_events: Fix use after free / double-free of JSON message.<br><br>When stasis_app_message_handler needs to queue a message for a later<br>connection it needs to bump the message reference so it doesn't get<br>freed when the caller releases it's reference.<br><br>Change-Id: I82696df8fe723b3365c15c3f7089501da8daa892<br>---<br>M res/ari/resource_events.c<br>1 file changed, 3 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/res/ari/resource_events.c b/res/ari/resource_events.c<br>index 4be5d02..992c562 100644<br>--- a/res/ari/resource_events.c<br>+++ b/res/ari/resource_events.c<br>@@ -108,7 +108,9 @@<br> msg_application);<br> } else if (!session->ws_session) {<br> /* If the websocket is NULL, the message goes to the queue */<br>- AST_VECTOR_APPEND(&session->message_queue, message);<br>+ if (!AST_VECTOR_APPEND(&session->message_queue, message)) {<br>+ ast_json_ref(message);<br>+ }<br> ast_log(LOG_WARNING,<br> "Queued '%s' message for Stasis app '%s'; websocket is not ready\n",<br> msg_type,<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7048">change 7048</a>. To unsubscribe, 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/7048"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I82696df8fe723b3365c15c3f7089501da8daa892 </div>
<div style="display:none"> Gerrit-Change-Number: 7048 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>