diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-21 22:38:54 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2009-07-21 22:38:54 +0000 |
commit | 4f22c15a9080341cb5635c94bc7236ba710f374d (patch) | |
tree | 4a38d034cb1dc53ed7de23e2d504ee10939ae6c6 /funcs | |
parent | d746f64f33cd315bd4668ea65010a45832f5a5ea (diff) |
Force an error if a blank is passed to QUOTE (because the documentation states the argument is not optional).
This change makes URIENCODE and QUOTE behave similarly, since the documentation
states that the argument is not optional, for both.
(closes issue #15439)
Reported by: pkempgen
Patches:
20090706__issue15439.diff.txt uploaded by tilghman (license 14)
git-svn-id: http://svn.digium.com/svn/asterisk/branches/1.4@207945 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs')
-rw-r--r-- | funcs/func_strings.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 8b0d562ba..b0e7dfb50 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -384,6 +384,12 @@ static struct ast_custom_function sprintf_function = { static int quote(struct ast_channel *chan, char *cmd, char *data, char *buf, size_t len) { char *bufptr = buf, *dataptr = data; + if (ast_strlen_zero(data)) { + ast_log(LOG_WARNING, "No argument specified!\n"); + ast_copy_string(buf, "\"\"", len); + return 0; + } + *bufptr++ = '"'; for (; bufptr < buf + len - 1; dataptr++) { if (*dataptr == '\\') { |