aboutsummaryrefslogtreecommitdiffstats
path: root/funcs/func_strings.c
diff options
context:
space:
mode:
authortilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-21 22:47:31 +0000
committertilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b>2009-07-21 22:47:31 +0000
commit1d5a7513632882385e9d4df6f5731f3aad34af40 (patch)
tree4d4f9c19fd9c568f764899ea908a377cb1fc6712 /funcs/func_strings.c
parenta1c9e3b334dd04095ddef6f7034a944573d224d4 (diff)
Merged revisions 207946 via svnmerge from
https://origsvn.digium.com/svn/asterisk/trunk ................ r207946 | tilghman | 2009-07-21 17:45:32 -0500 (Tue, 21 Jul 2009) | 15 lines Merged revisions 207945 via svnmerge from https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r207945 | tilghman | 2009-07-21 17:38:54 -0500 (Tue, 21 Jul 2009) | 8 lines 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.6.0@207947 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r--funcs/func_strings.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c
index de754be68..f2be6f560 100644
--- a/funcs/func_strings.c
+++ b/funcs/func_strings.c
@@ -580,6 +580,12 @@ static struct ast_custom_function sprintf_function = {
static int quote(struct ast_channel *chan, const 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 == '\\') {