<p>Jenkins2 <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/7807">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Richard Mudgett: Looks good to me, but someone else must approve
Joshua Colp: Looks good to me, approved
Jenkins2: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">pbx: Prevent execution of NULL pointer.<br><br>pbx_extension_helper has a check for q->swo.exec == NULL but it doesn't<br>actually return so we would still run the function. Fix the return.<br>Move the 'int res' variable into the only scope which uses it.<br><br>Change-Id: I0693af921fdc7f56b6a72a21fb816ed08b960a69<br>---<br>M main/pbx.c<br>1 file changed, 6 insertions(+), 4 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/pbx.c b/main/pbx.c<br>index 173b62e..b313e05 100644<br>--- a/main/pbx.c<br>+++ b/main/pbx.c<br>@@ -2823,7 +2823,6 @@<br> struct ast_exten *e;<br> struct ast_app *app;<br> char *substitute = NULL;<br>- int res;<br> struct pbx_find_info q = { .stacklen = 0 }; /* the rest is reset in pbx_find_extension */<br> char passdata[EXT_DATA_SIZE];<br> int matching_action = (action == E_MATCH || action == E_CANMATCH || action == E_MATCHMORE);<br>@@ -2840,9 +2839,12 @@<br> ast_unlock_contexts();<br> return -1; /* success, we found it */<br> } else if (action == E_FINDLABEL) { /* map the label to a priority */<br>- res = e->priority;<br>+ int res = e->priority;<br>+<br> ast_unlock_contexts();<br>- return res; /* the priority we were looking for */<br>+<br>+ /* the priority we were looking for */<br>+ return res;<br> } else { /* spawn */<br> if (!e->cached_app)<br> e->cached_app = pbx_findapp(e->app);<br>@@ -2892,7 +2894,7 @@<br> } else {<br> if (!q.swo->exec) {<br> ast_log(LOG_WARNING, "No execution engine for switch %s\n", q.swo->name);<br>- res = -1;<br>+ return -1;<br> }<br> return q.swo->exec(c, q.foundcontext ? q.foundcontext : context, exten, priority, callerid, q.data);<br> }<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/7807">change 7807</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/7807"/><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-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: I0693af921fdc7f56b6a72a21fb816ed08b960a69 </div>
<div style="display:none"> Gerrit-Change-Number: 7807 </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: 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>