diff options
author | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-02 05:15:59 +0000 |
---|---|---|
committer | murf <murf@f38db490-d61c-443f-a65b-d21fe96a405b> | 2008-08-02 05:15:59 +0000 |
commit | a75ccb90938a61b6dcae3f499a0ac9b58ea19264 (patch) | |
tree | 87dd543c1b6e1190f4e3031e318c3ee9e22a122c /main/pbx.c | |
parent | 1d7dad7983ed4b8ee0d8547ac114c838c602898c (diff) |
Merged revisions 135265 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk
........
r135265 | murf | 2008-08-01 22:51:29 -0600 (Fri, 01 Aug 2008) | 31 lines
(closes issue #13202)
Reported by: falves11
Tested by: murf
falves11 ==
The changes I introduce here seem to clear up the problem
for me. However, if they do not for you, please reopen this
bug, and we'll keep digging.
The root of this problem seems to be a subtle memory corruption
introduced when creating an extension with an empty extension
name. While valgrind cannot detect it outside of DEBUG_MALLOC
mode, when compiled with DEBUG_MALLOC, this is certain death.
The code in main/features.c is a puzzle to me. On the initial
module load, the code is attempting to add the parking extension
before the features.conf file has even been opened!
I just wrapped the offending call with an if() that will not
try to add the extension if the extension name is empty. THis
seems to solve the corruption, and let the "memory show allocations"
work as one would expect.
But, really, adding an extension with an empty name is a seriously
bad thing to allow, as it will mess up all the pattern matching
algorithms, etc. So, I added a statement to the add_extension2 code to return
a -1 if this is attempted.
in 1.6.0, the changes to only main/pbx.c were applicable,
as apparently the code added to main/features by jpeeler
were not included in 1.6.0.
........
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.6.0@135266 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/main/pbx.c b/main/pbx.c index a4b490f59..7aea5d2a7 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -6702,6 +6702,11 @@ int ast_add_extension2(struct ast_context *con, struct ast_exten dummy_exten = {0}; char dummy_name[1024]; + if (ast_strlen_zero(extension)) { + ast_log(LOG_ERROR,"You have to be kidding-- add exten '' to context %s? Figure out a name and call me back. Action ignored.\n", + con->name); + return -1; + } /* if we are adding a hint, and there are global variables, and the hint contains variable references, then expand them */ |