Issue #5737
authorJosh Roberson <josh@asteriasgi.com>
Tue, 15 Nov 2005 01:33:31 +0000 (01:33 +0000)
committerJosh Roberson <josh@asteriasgi.com>
Tue, 15 Nov 2005 01:33:31 +0000 (01:33 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7097 65c4cc65-6c06-0410-ace0-fbb531ad65f3

ChangeLog
manager.c

index 96320a6..8f8c5df 100755 (executable)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,7 @@
+2005-11-14  Josh Roberson <josh@asteirasgi.com>
+       
+       * Fix crash on variable passing from AMI originate (issue #5737)
+
 2005-11-14  Russell Bryant  <russell@digium.com>
 
        * many files: Merge doxygen documentation updates. (issue #5605)
index 1be1a38..629cad2 100755 (executable)
--- a/manager.c
+++ b/manager.c
@@ -329,9 +329,11 @@ struct ast_variable *astman_get_variables(struct message *m)
                if (!(var = ast_strdupa(m->headers[x] + varlen)))
                        return head;
 
-               if ((var_count = ast_app_separate_args(var, '|', vars, sizeof(vars) / sizeof(var[0])))) {
+               if ((var_count = ast_app_separate_args(var, '|', vars, sizeof(vars) / sizeof(vars[0])))) {
                        for (y = 0; y < var_count; y++) {
-                               var = val = vars[y];
+                               if (!vars[y])
+                                       continue;
+                               var = val = ast_strdupa(vars[y]);
                                strsep(&val, "=");
                                if (!val || ast_strlen_zero(var))
                                        continue;