[asterisk-commits] tilghman: branch 1.4 r207945 - /branches/1.4/funcs/func_strings.c
SVN commits to the Asterisk project
asterisk-commits at lists.digium.com
Tue Jul 21 17:38:58 CDT 2009
Author: tilghman
Date: Tue Jul 21 17:38:54 2009
New Revision: 207945
URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=207945
Log:
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)
Modified:
branches/1.4/funcs/func_strings.c
Modified: branches/1.4/funcs/func_strings.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.4/funcs/func_strings.c?view=diff&rev=207945&r1=207944&r2=207945
==============================================================================
--- branches/1.4/funcs/func_strings.c (original)
+++ branches/1.4/funcs/func_strings.c Tue Jul 21 17:38:54 2009
@@ -384,6 +384,12 @@
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 == '\\') {
More information about the asterisk-commits
mailing list