[Asterisk-code-review] pbx.c: Fix handling of '-' in extension name and callerid (asterisk[13])

Corey Farrell asteriskteam at digium.com
Thu Jul 28 19:01:36 CDT 2016


Hello Anonymous Coward #1000019,

I'd like you to reexamine a change.  Please visit

    https://gerrit.asterisk.org/3365

to look at the new patch set (#2).

Change subject: pbx.c: Fix handling of '-' in extension name and callerid
......................................................................

pbx.c: Fix handling of '-' in extension name and callerid

This adds a two strings to ast_exten.  name to go with exten and
cidmatch_display to go with cidmatch.  The new fields contain input used
to add the extension in the first place.  The existing fields now
contain stripped input that excludes insignificant spaces and dashes.
These stripped fields should always be used for comparisons.  The
unstripped fields should normally be used for display, but displaying
stripped values will not cause runtime errors.

Note the actual string is only stored twice if it contains dashes.  If
no dashes are found then both 'char *' fields point to the same memory.
So this change has a minimum effect on memory usage.

The existing functions ast_get_extension_name and
ast_get_extension_cidmatch return unstripped values as they did before
this change.  Other similar bugs likely still exist where unstripped
extensions are saved outside pbx.c then passed back in.

ASTERISK-26233 #close

Change-Id: I6cd61ce57acc1570ca6cc14960c4c3b0a9eb837f
---
M main/pbx.c
1 file changed, 143 insertions(+), 51 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/65/3365/2
-- 
To view, visit https://gerrit.asterisk.org/3365
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I6cd61ce57acc1570ca6cc14960c4c3b0a9eb837f
Gerrit-PatchSet: 2
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Corey Farrell <git at cfware.com>
Gerrit-Reviewer: Anonymous Coward #1000019



More information about the asterisk-code-review mailing list