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

Corey Farrell asteriskteam at digium.com
Wed Jul 27 03:44:14 CDT 2016


Hello Anonymous Coward #1000019,

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

    https://gerrit.asterisk.org/3353

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

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, 113 insertions(+), 42 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/53/3353/3
-- 
To view, visit https://gerrit.asterisk.org/3353
To unsubscribe, visit https://gerrit.asterisk.org/settings

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



More information about the asterisk-code-review mailing list