[asterisk-commits] tilghman: branch 1.6.0 r193781 - in /branches/1.6.0: ./ apps/app_voicemail.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon May 11 18:23:24 CDT 2009


Author: tilghman
Date: Mon May 11 18:23:15 2009
New Revision: 193781

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=193781
Log:
Recorded merge of revisions 193756 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r193756 | tilghman | 2009-05-11 17:50:47 -0500 (Mon, 11 May 2009) | 25 lines
  
  Recorded merge of revisions 193755 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r193755 | tilghman | 2009-05-11 17:48:20 -0500 (Mon, 11 May 2009) | 18 lines
    
    Move 300 bytes around on the stack, to make more room for an extension buffer.
    This allows more concurrent extensions to be copied for a single voicemail,
    without creating a possibility of upsetting existing users, where a dialplan
    could run out of stack space where it had run fine before.  Alternatively,
    we could have allocated off the heap, but that is a larger change and would
    have increased the chance for instability introduced by this change.
    
    This is really solved starting in 1.6.0.11, as the use of an ast_str buffer
    allows an unlimited number of extensions (up to available memory).  We
    additionally create a new warning message when the buffer length is exceeded,
    permitting administrators to see an issue after the fact, whereas previously
    the list was silently truncated.
    (closes issue #14739)
     Reported by: p_lindheimer
     Patches: 
           20090417__bug14739.diff.txt uploaded by tilghman (license 14)
     Tested by: p_lindheimer
  ........
................

Modified:
    branches/1.6.0/   (props changed)
    branches/1.6.0/apps/app_voicemail.c

Propchange: branches/1.6.0/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.0/apps/app_voicemail.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.0/apps/app_voicemail.c?view=diff&rev=193781&r1=193780&r2=193781
==============================================================================
--- branches/1.6.0/apps/app_voicemail.c (original)
+++ branches/1.6.0/apps/app_voicemail.c Mon May 11 18:23:15 2009
@@ -226,6 +226,8 @@
 #define ERROR_LOCK_PATH  -100
 #define ERROR_MAILBOX_FULL	-200
 
+
+AST_THREADSTORAGE(voicemail_extension_list);
 
 enum {
 	NEW_FOLDER,
@@ -4289,14 +4291,15 @@
 		char fmt[80];
 		char *context;
 		char ecodes[17] = "#";
-		char tmp[1024] = "", *tmpptr;
+		char *tmpptr;
+		struct ast_str *tmp = ast_str_thread_get(&voicemail_extension_list, 16);
 		struct ast_vm_user *vmu;
 		struct ast_vm_user svm;
 		const char *category = NULL, *code, *alldtmf = "0123456789ABCD*#";
 
-		ast_copy_string(tmp, ext, sizeof(tmp));
-		ext = tmp;
-		if ((context = strchr(tmp, '@'))) {
+		ast_str_set(&tmp, 0, "%s", ext);
+		ext = ast_str_buffer(tmp);
+		if ((context = strchr(ext, '@'))) {
 			*context++ = '\0';
 			tmpptr = strchr(context, '&');
 		} else {




More information about the asterisk-commits mailing list