mirror of
https://github.com/asterisk/asterisk.git
synced 2025-11-09 11:28:25 +00:00
Merged revisions 290712 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.6.2 ........ r290712 | russell | 2010-10-07 12:53:56 +0200 (Thu, 07 Oct 2010) | 4 lines Don't crash when Set() is called without a value. Review: https://reviewboard.asterisk.org/r/949/ ........ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@290713 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
11
main/pbx.c
11
main/pbx.c
@@ -9550,11 +9550,18 @@ int pbx_builtin_setvar(struct ast_channel *chan, const char *data)
|
|||||||
mydata = ast_strdupa(data);
|
mydata = ast_strdupa(data);
|
||||||
name = strsep(&mydata, "=");
|
name = strsep(&mydata, "=");
|
||||||
value = mydata;
|
value = mydata;
|
||||||
if (strchr(name, ' '))
|
if (!value) {
|
||||||
|
ast_log(LOG_WARNING, "Set requires an '=' to be a valid assignment.\n");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (strchr(name, ' ')) {
|
||||||
ast_log(LOG_WARNING, "Please avoid unnecessary spaces on variables as it may lead to unexpected results ('%s' set to '%s').\n", name, mydata);
|
ast_log(LOG_WARNING, "Please avoid unnecessary spaces on variables as it may lead to unexpected results ('%s' set to '%s').\n", name, mydata);
|
||||||
|
}
|
||||||
|
|
||||||
pbx_builtin_setvar_helper(chan, name, value);
|
pbx_builtin_setvar_helper(chan, name, value);
|
||||||
return(0);
|
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
int pbx_builtin_setvar_multiple(struct ast_channel *chan, const char *vdata)
|
int pbx_builtin_setvar_multiple(struct ast_channel *chan, const char *vdata)
|
||||||
|
|||||||
Reference in New Issue
Block a user