From: Jonathan Rose Date: Tue, 8 Mar 2011 20:19:32 +0000 (+0000) Subject: Returns with an error notice if CHANNEL function of SIP channel is read without argum... X-Git-Tag: 1.8.5-rc1~11^2~283 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=ed3e04e8312a5b0d728cf15c548a1d7356c0dafd;p=thirdparty%2Fasterisk.git Returns with an error notice if CHANNEL function of SIP channel is read without arguments. (Closes issue #18653) Reported by: wuwu Patches: diff.patch uploaded by jrose (license 1225) Tested by: jrose git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@310088 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/channels/sip/dialplan_functions.c b/channels/sip/dialplan_functions.c index e14975d5dd..7454d699bb 100644 --- a/channels/sip/dialplan_functions.c +++ b/channels/sip/dialplan_functions.c @@ -47,6 +47,13 @@ int sip_acf_channel_read(struct ast_channel *chan, const char *funcname, char *p AST_APP_ARG(type); AST_APP_ARG(field); ); + + /* Check for zero arguments */ + if (ast_strlen_zero(parse)) { + ast_log(LOG_ERROR, "Cannot call %s without arguments\n", funcname); + return -1; + } + AST_STANDARD_APP_ARGS(args, parse); /* Sanity check */