mirror of
https://github.com/asterisk/asterisk.git
synced 2025-09-30 10:33:13 +00:00
don't crash on setvar (issue #5760)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@7099 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
@@ -1,5 +1,7 @@
|
|||||||
2005-11-15 Russell Bryant <russell@digium.com>
|
2005-11-15 Russell Bryant <russell@digium.com>
|
||||||
|
|
||||||
|
* manager.c: Don't crash on a SetVar action if the channel name is not set, or variable's value is not set (issue #5760)
|
||||||
|
|
||||||
* doc/README.variables: Add application exit status variables
|
* doc/README.variables: Add application exit status variables
|
||||||
|
|
||||||
2005-11-14 Josh Roberson <josh@asteirasgi.com>
|
2005-11-14 Josh Roberson <josh@asteirasgi.com>
|
||||||
|
11
manager.c
11
manager.c
@@ -690,6 +690,11 @@ static int action_setvar(struct mansession *s, struct message *m)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (ast_strlen_zero(varval)) {
|
||||||
|
astman_send_error(s, m, "No value specified");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (!ast_strlen_zero(name)) {
|
if (!ast_strlen_zero(name)) {
|
||||||
c = ast_get_channel_by_name_locked(name);
|
c = ast_get_channel_by_name_locked(name);
|
||||||
if (!c) {
|
if (!c) {
|
||||||
@@ -698,9 +703,11 @@ static int action_setvar(struct mansession *s, struct message *m)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pbx_builtin_setvar_helper(c,varname,varval);
|
pbx_builtin_setvar_helper(c, varname, varval);
|
||||||
|
|
||||||
|
if (c)
|
||||||
|
ast_mutex_unlock(&c->lock);
|
||||||
|
|
||||||
ast_mutex_unlock(&c->lock);
|
|
||||||
astman_send_ack(s, m, "Variable Set");
|
astman_send_ack(s, m, "Variable Set");
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
Reference in New Issue
Block a user