Merged revisions 310088 via svnmerge from
authorJonathan Rose <jrose@digium.com>
Tue, 8 Mar 2011 20:34:05 +0000 (20:34 +0000)
committerJonathan Rose <jrose@digium.com>
Tue, 8 Mar 2011 20:34:05 +0000 (20:34 +0000)
https://origsvn.digium.com/svn/asterisk/branches/1.8

........
  r310088 | jrose | 2011-03-08 14:19:32 -0600 (Tue, 08 Mar 2011) | 9 lines

  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/trunk@310089 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/sip/dialplan_functions.c

index abf83e7..0d019c5 100644 (file)
@@ -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 */