Merged revisions 61683 via svnmerge from
authorTilghman Lesher <tilghman@meg.abyt.es>
Thu, 19 Apr 2007 04:37:29 +0000 (04:37 +0000)
committerTilghman Lesher <tilghman@meg.abyt.es>
Thu, 19 Apr 2007 04:37:29 +0000 (04:37 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.4

........
r61683 | tilghman | 2007-04-18 23:36:20 -0500 (Wed, 18 Apr 2007) | 2 lines

Bug 9557 - simple reason why reading a function always returned NULL

........

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

main/manager.c

index 8cff7ce..9c6f2af 100644 (file)
@@ -1483,7 +1483,7 @@ static int action_getvar(struct mansession *s, const struct message *m)
        const char *name = astman_get_header(m, "Channel");
        const char *varname = astman_get_header(m, "Variable");
        char *varval;
-       char workspace[1024];
+       char workspace[1024] = "";
 
        if (ast_strlen_zero(varname)) {
                astman_send_error(s, m, "No variable specified");
@@ -1500,6 +1500,7 @@ static int action_getvar(struct mansession *s, const struct message *m)
 
        if (varname[strlen(varname) - 1] == ')') {
                ast_func_read(c, (char *) varname, workspace, sizeof(workspace));
+               varval = workspace;
        } else {
                pbx_retrieve_variable(c, varname, &varval, workspace, sizeof(workspace), NULL);
        }