[Home]

Summary:ASTERISK-18807: [patch] pbx.c silently allows duplicate labels for the same extension, and shouldn't. Suggested [patch] included!
Reporter:Kenneth Shumard (kshumard)Labels:
Date Opened:2011-11-02 14:06:39Date Closed:2011-12-05 09:00:16.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:PBX/General
Versions:SVN Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) pbx.c.patch
Description:[foo]
exten => 1,1,Noop
same => n,Goto(bar)
same => n(bar),Noop(${PRIORITY})
same => n,Noop()
same => n(bar),Noop(${PRIORITY})

Priority label 'bar' is repeated, which is an error that Asterisk currently doesn't detect or address - it silently creates the priority, with a duplicate label. Attached patch prevents this behavior by checking for an identical existing label as the priorities are walked in add_priority, and refusing to create the new priority if an identical label is found.
Comments:By: Jonathan Rose (jrose) 2011-12-02 16:12:46.887-0600

We are actually going to go ahead and use the priority specified with the repeated label, but go ahead and discard the repeated label and write the warning message anyway.  I'm a little worried that this might mess with mixed pattern matching and calls handled by multiple contexts/inclusion, so there will be some testing involved as well.