Merged revisions 19891 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 13 Apr 2006 20:40:23 +0000 (20:40 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 13 Apr 2006 20:40:23 +0000 (20:40 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.2

........
r19891 | tilghman | 2006-04-13 15:37:50 -0500 (Thu, 13 Apr 2006) | 2 lines

Bug 6947 - Allow vm broadcasts to more than 256 characters worth of mailboxes

........

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@19892 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_voicemail.c

index ee726f3..ae061de 100644 (file)
@@ -5604,7 +5604,7 @@ static int vm_exec(struct ast_channel *chan, void *data)
 {
        int res = 0;
        struct localuser *u;
 {
        int res = 0;
        struct localuser *u;
-       char tmp[256];
+       char *tmp;
        struct leave_vm_options leave_options;
        struct ast_flags flags = { 0 };
        char *opts[OPT_ARG_ARRAY_SIZE];
        struct leave_vm_options leave_options;
        struct ast_flags flags = { 0 };
        char *opts[OPT_ARG_ARRAY_SIZE];
@@ -5621,7 +5621,12 @@ static int vm_exec(struct ast_channel *chan, void *data)
                ast_answer(chan);
 
        if (!ast_strlen_zero(data)) {
                ast_answer(chan);
 
        if (!ast_strlen_zero(data)) {
-               ast_copy_string(tmp, data, sizeof(tmp));
+               tmp = ast_strdupa((char *)data);
+               if (!tmp) {
+                       ast_log(LOG_ERROR, "Out of memory\n");
+                       LOCAL_USER_REMOVE(u);
+                       return -1;
+               }
                AST_STANDARD_APP_ARGS(args, tmp);
                if (args.argc == 2) {
                        if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) {
                AST_STANDARD_APP_ARGS(args, tmp);
                if (args.argc == 2) {
                        if (ast_app_parse_options(vm_app_options, &flags, opts, args.argv1)) {
@@ -5657,6 +5662,7 @@ static int vm_exec(struct ast_channel *chan, void *data)
                        }
                }
        } else {
                        }
                }
        } else {
+               char tmp[256];
                res = ast_app_getdata(chan, "vm-whichbox", tmp, sizeof(tmp) - 1, 0);
                if (res < 0) {
                        LOCAL_USER_REMOVE(u);
                res = ast_app_getdata(chan, "vm-whichbox", tmp, sizeof(tmp) - 1, 0);
                if (res < 0) {
                        LOCAL_USER_REMOVE(u);