From: Tilghman Lesher Date: Tue, 21 Jul 2009 22:48:53 +0000 (+0000) Subject: Merged revisions 207946 via svnmerge from X-Git-Tag: 1.6.1.3-rc1~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2321ba5580526fb934245a3c318ef98ee1b49e25;p=thirdparty%2Fasterisk.git 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: https://origsvn.digium.com/svn/asterisk/branches/1.6.1@207948 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_strings.c b/funcs/func_strings.c index b2bcc8b90b..1cd55739eb 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 == '\\') {