<p>Corey Farrell has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/7805">View Change</a></p><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>Also 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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/05/7805/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/main/pbx.c b/main/pbx.c<br>index 12daa67..ecdd9a0 100644<br>--- a/main/pbx.c<br>+++ b/main/pbx.c<br>@@ -2863,7 +2863,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>@@ -2880,9 +2879,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>@@ -2932,7 +2934,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/7805">change 7805</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/7805"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I0693af921fdc7f56b6a72a21fb816ed08b960a69 </div>
<div style="display:none"> Gerrit-Change-Number: 7805 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Corey Farrell <git@cfware.com> </div>