diff options
author | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-03 06:32:35 +0000 |
---|---|---|
committer | tilghman <tilghman@f38db490-d61c-443f-a65b-d21fe96a405b> | 2006-07-03 06:32:35 +0000 |
commit | 668c0802643650d9b9f5823e087f77a9803eea95 (patch) | |
tree | aaa43fd809072f40f5e48f3d3ffe2bbaa0f86eab /funcs/func_strings.c | |
parent | a86cb2865eef463f2b5767753ae15cb07aabf726 (diff) |
Don't attempt to run a regcomp if we haven't even parsed arguments correctly
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@36777 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'funcs/func_strings.c')
-rw-r--r-- | funcs/func_strings.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/funcs/func_strings.c b/funcs/func_strings.c index 97132a515..fcecb77fd 100644 --- a/funcs/func_strings.c +++ b/funcs/func_strings.c @@ -119,6 +119,11 @@ static int regex(struct ast_channel *chan, char *cmd, char *parse, char *buf, AST_NONSTANDARD_APP_ARGS(args, parse, '"'); + if (args.argc != 3) { + ast_log(LOG_ERROR, "Unexpected arguments: should have been in the form '\"<regex>\" <string>'\n"); + return -1; + } + ast_log(LOG_DEBUG, "FUNCTION REGEX (%s)(%s)\n", args.reg, args.str); if ((errcode = regcomp(®exbuf, args.reg, REG_EXTENDED | REG_NOSUB))) { |