<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7878">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
Richard Mudgett: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">app_confbridge: Fix NULL check in action_kick_last.<br><br>The check for last_user == NULL needs to happen before we dereference<br>the variable, previously it was possible for us to check flags of a NULL<br>last_user.<br><br>Change-Id: I274f737aa8af9d2d53e4a78cdd7ad57561003945<br>---<br>M apps/app_confbridge.c<br>1 file changed, 9 insertions(+), 3 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/apps/app_confbridge.c b/apps/app_confbridge.c<br>index 73dff86..f972e38 100644<br>--- a/apps/app_confbridge.c<br>+++ b/apps/app_confbridge.c<br>@@ -2689,17 +2689,23 @@<br> }<br> <br> ao2_lock(conference);<br>- if (((last_user = AST_LIST_LAST(&conference->active_list)) == user)<br>- || (ast_test_flag(&last_user->u_profile, USER_OPT_ADMIN))) {<br>+ last_user = AST_LIST_LAST(&conference->active_list);<br>+ if (!last_user) {<br>+ ao2_unlock(conference);<br>+ return 0;<br>+ }<br>+<br>+ if (last_user == user || ast_test_flag(&last_user->u_profile, USER_OPT_ADMIN)) {<br> ao2_unlock(conference);<br> play_file(bridge_channel, NULL,<br> conf_get_sound(CONF_SOUND_ERROR_MENU, conference->b_profile.sounds));<br>- } else if (last_user && !last_user->kicked) {<br>+ } else if (!last_user->kicked) {<br> last_user->kicked = 1;<br> pbx_builtin_setvar_helper(last_user->chan, "CONFBRIDGE_RESULT", "KICKED");<br> ast_bridge_remove(conference->bridge, last_user->chan);<br> ao2_unlock(conference);<br> }<br>+<br> return 0;<br> }<br> <br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7878">change 7878</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/7878"/><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: I274f737aa8af9d2d53e4a78cdd7ad57561003945 </div>
<div style="display:none"> Gerrit-Change-Number: 7878 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: 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>