<p>Sean Bright has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/11260">View Change</a></p><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-18362 #close<br>Reported by: Dennis<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;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/60/11260/1</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 bbfeb2d..bcac63a 100644</span><br><span>--- a/res/ael/pval.c</span><br><span>+++ b/res/ael/pval.c</span><br><span>@@ -760,10 +760,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>@@ -793,14 +793,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/+/11260">change 11260</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/+/11260"/><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-Change-Id: I8d2cccb3479168fba1b0a6704c52198b396468f1 </div>
<div style="display:none"> Gerrit-Change-Number: 11260 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Sean Bright <sean.bright@gmail.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>