]> git.ipfire.org Git - thirdparty/asterisk.git/commit
app_directory: Fix crash when using the alias option 'a'. 38/638/1
authorRichard Mudgett <rmudgett@digium.com>
Thu, 11 Jun 2015 19:39:45 +0000 (14:39 -0500)
committerRichard Mudgett <rmudgett@digium.com>
Thu, 11 Jun 2015 19:39:45 +0000 (14:39 -0500)
commita2f4d03c87bb67892a8b846c59bd26e9163054e9
treed910700a4eb31f7e5ad5257ce1a9a4ce8c8ca937
parent006930ee51919ee47abe0f7c7a8469cff0d31e9f
app_directory: Fix crash when using the alias option 'a'.

The voicemail.conf mailbox key/value pair is defined as:
<mailbox>=[<password>[,<full-name>[,<email>[,<pager>[,<options>]]]]]
Where all fields in the value including the field values are optional.

Since the parsing code for the mailbox key/value pair is sloppy, this
patch tightens the parsing for the directory information.

* Renamed the 'pos' and 'bufptr' variables to 'name' and 'options'
respectively in search_directory_sub().  Those names make more sense.

* Made sure that search_directory_sub() is dealing with the voicemail.conf
mailbox options field if it even exists when looking for the 'hidefromdir'
and 'alias' options.

* Fix crash if a voicemail.conf mailbox is just
<mailbox>=<password>,<name> when the 'a' option is used.  If there were no
fields after the name then the 'options' pointer was not checked for NULL.

* Fix users.conf alias processing if the 'a' option is used.  The wrong
variable was used.

ASTERISK-25087 #close
Reported by: Chet Stevens

Change-Id: I86052ea77307beddddba5279824d39dc0d593374
apps/app_directory.c