]> git.ipfire.org Git - thirdparty/asterisk.git/commit
config: bug: Fix SEGV in ast_category_insert when matching category isn't found
authorGeorge Joseph <george.joseph@fairview5.com>
Thu, 18 Sep 2014 14:45:04 +0000 (14:45 +0000)
committerGeorge Joseph <george.joseph@fairview5.com>
Thu, 18 Sep 2014 14:45:04 +0000 (14:45 +0000)
commit0a2e6a1c7e2e32c74ac526c0bfe184bc39a33a58
treefa17fa7387ef7f4f62edfadaba11106c9e97cb17
parentc48b609fb3e2da71ada2ec883334a77e089f3b8f
config: bug: Fix SEGV in ast_category_insert when matching category isn't found

If you call ast_category_insert with a match category that doesn't exist, the
list traverse runs out of 'next' categories and you get a SEGV.  This patch
adds check for the end-of-list condition and changes the signature to return
an int for success/failure indication instead of a void.

The only consumer of this function is manager and it was also changed to use
the return value.

Tested by: George Joseph
Review: https://reviewboard.asterisk.org/r/3993/
........

Merged revisions 423276 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 423277 from http://svn.asterisk.org/svn/asterisk/branches/11
........

Merged revisions 423278 from http://svn.asterisk.org/svn/asterisk/branches/12

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/13@423279 65c4cc65-6c06-0410-ace0-fbb531ad65f3
include/asterisk/config.h
main/config.c
main/manager.c