]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx.c: put copy of ast_exten.data on stack to prevent memory corruption
authorScott Griepentrog <sgriepentrog@digium.com>
Mon, 16 Dec 2013 15:55:04 +0000 (15:55 +0000)
committerScott Griepentrog <sgriepentrog@digium.com>
Mon, 16 Dec 2013 15:55:04 +0000 (15:55 +0000)
commitfaf4f6187b8c2f90765737287de4336b8f440b87
tree90d15149b890741538c6f92ea3a2e618a83f0365
parent8d5186ef53863a3a6b851e86504dbe38eae1a2bd
pbx.c: put copy of ast_exten.data on stack to prevent memory corruption

During dialplan execution in pbx_extension_helper(), the contexts global
read lock prevents link list corruption, but was released with a pointer
to the ast_exten and data later used in variable substitution.  Instead,
this patch removes pbx_substitute_variables() and locates a copy of the
ast_exten data on the stack before releasing the lock, where ast_exten
could get free'd by another thread performing a module reload.

(issue AST-1179)
Reported by: Thomas Arimont
(issue AST-1246)
Reported by: Alexander Hömig
Review: https://reviewboard.asterisk.org/r/3055/
........

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

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/11@403863 65c4cc65-6c06-0410-ace0-fbb531ad65f3
main/pbx.c