aboutsummaryrefslogtreecommitdiffstats
path: root/funcs
diff options
context:
space:
mode:
Diffstat (limited to 'funcs')
-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 b2bcc8b90..1cd55739e 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 == '\\') {