<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11261">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Benjamin Keith Ford: Looks good to me, but someone else must approve
George Joseph: Looks good to me, approved
Friendly Automation: Approved for Submit
</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_ael: Fix pattern matching against literal '+'<br><br>When generating the regular expression that matches against existing<br>extensions, we need to escape literal characters that can also be<br>regular expression metacharacters. This was already being done for '*'<br>but we need to do the same for '+'.<br><br>In passing, remove some unreachable code - strcmp() is already run<br>immediately when entering extension_matches().<br><br>ASTERISK-14939 #close<br>Reported by: klaus3000<br><br>Change-Id: I8d2cccb3479168fba1b0a6704c52198b396468f1<br>---<br>M res/ael/pval.c<br>1 file changed, 5 insertions(+), 10 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/ael/pval.c b/res/ael/pval.c</span><br><span>index f927077..37d53ad 100644</span><br><span>--- a/res/ael/pval.c</span><br><span>+++ b/res/ael/pval.c</span><br><span>@@ -759,10 +759,10 @@</span><br><span> *r++ = '.';</span><br><span> *r++ = '*';</span><br><span> break;</span><br><span style="color: hsl(0, 100%, 40%);">- case '*':</span><br><span style="color: hsl(120, 100%, 40%);">+ case '*': /* regex metacharacter */</span><br><span style="color: hsl(120, 100%, 40%);">+ case '+': /* regex metacharacter */</span><br><span> *r++ = '\\';</span><br><span style="color: hsl(0, 100%, 40%);">- *r++ = '*';</span><br><span style="color: hsl(0, 100%, 40%);">- break;</span><br><span style="color: hsl(120, 100%, 40%);">+ /* fall through */</span><br><span> default:</span><br><span> *r++ = *p;</span><br><span> break;</span><br><span>@@ -792,14 +792,9 @@</span><br><span> exten, pattern); */</span><br><span> return 1;</span><br><span> }</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">-</span><br><span style="color: hsl(0, 100%, 40%);">- } else {</span><br><span style="color: hsl(0, 100%, 40%);">- if ( strcmp(exten,pattern) == 0 ) {</span><br><span style="color: hsl(0, 100%, 40%);">- return 1;</span><br><span style="color: hsl(0, 100%, 40%);">- } else</span><br><span style="color: hsl(0, 100%, 40%);">- return 0;</span><br><span> }</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span style="color: hsl(120, 100%, 40%);">+ return 0;</span><br><span> }</span><br><span> </span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/11261">change 11261</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/+/11261"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I8d2cccb3479168fba1b0a6704c52198b396468f1 </div>
<div style="display:none"> Gerrit-Change-Number: 11261 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </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: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: merged </div>