diff options
author | Russell Bryant <russell@russellbryant.com> | 2010-10-07 11:12:50 +0000 |
---|---|---|
committer | Russell Bryant <russell@russellbryant.com> | 2010-10-07 11:12:50 +0000 |
commit | 5f523a5de56c755921280f9af0703ceaa3bbc19d (patch) | |
tree | 9cbc5b4affed0511b1eae9f2c6441d3dae990922 /main/pbx.c | |
parent | c6f89f7ca3eaa751e66da598331a4b60500d16dc (diff) |
Merged revisions 290713 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.8
................
r290713 | russell | 2010-10-07 13:00:52 +0200 (Thu, 07 Oct 2010) | 11 lines
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/trunk@290714 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'main/pbx.c')
-rw-r--r-- | main/pbx.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/main/pbx.c b/main/pbx.c index 9b44306bf..87ebdd854 100644 --- a/main/pbx.c +++ b/main/pbx.c @@ -9550,11 +9550,18 @@ int pbx_builtin_setvar(struct ast_channel *chan, const char *data) mydata = ast_strdupa(data); name = strsep(&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); + } pbx_builtin_setvar_helper(chan, name, value); - return(0); + + return 0; } int pbx_builtin_setvar_multiple(struct ast_channel *chan, const char *vdata) |