]> git.ipfire.org Git - thirdparty/asterisk.git/commit
pbx.c: put copy of ast_exten.data on stack to prevent memory corruption
authorMatthew Jordan <mjordan@digium.com>
Wed, 15 Jan 2014 15:27:36 +0000 (15:27 +0000)
committerMatthew Jordan <mjordan@digium.com>
Wed, 15 Jan 2014 15:27:36 +0000 (15:27 +0000)
commit505d1095a3a8f8d681d84336769e4a39a1f3d6db
tree7f2ad5e0eb0da6eb04c284d6e9bfd64fba9dcfbc
parent4b07aa5f132d2f97097ccd140a28f68b777b36f7
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
........

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

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