[asterisk-commits] murf: branch 1.6.0 r135266 - in /branches/1.6.0: ./ main/pbx.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Sat Aug 2 00:15:59 CDT 2008
Author: murf
Date: Sat Aug 2 00:15:59 2008
New Revision: 135266
URL: http://svn.digium.com/view/asterisk?view=rev&rev=135266
Log:
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.
........
Modified:
branches/1.6.0/ (props changed)
branches/1.6.0/main/pbx.c
Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.
Modified: branches/1.6.0/main/pbx.c
URL: http://svn.digium.com/view/asterisk/branches/1.6.0/main/pbx.c?view=diff&rev=135266&r1=135265&r2=135266
==============================================================================
--- branches/1.6.0/main/pbx.c (original)
+++ branches/1.6.0/main/pbx.c Sat Aug 2 00:15:59 2008
@@ -6702,6 +6702,11 @@
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
*/
More information about the asterisk-commits
mailing list