From: Mark Michelson Date: Tue, 1 May 2012 23:08:20 +0000 (+0000) Subject: Fix Coverity-reported ARRAY_VS_SINGLETON error. X-Git-Tag: 1.8.13.0-rc1~7 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=095054e4a1257e409190725d97e60a24827d6aed;p=thirdparty%2Fasterisk.git Fix Coverity-reported ARRAY_VS_SINGLETON error. As it turned out, this wasn't a huge deal. We were calling ast_app_parse_options() for a set of options of which none took arguments. The proper thing to do for this case is to pass NULL for the "args" parameter here. We were instead passing a seemingly-randomly chosen char * from the function. While this would never get written to, you can rest assured things would have gotten bad had new options (which took arguments) been added to func_volume. (closes issue ASTERISK-19656) git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@364899 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/funcs/func_volume.c b/funcs/func_volume.c index 6c2798e5a4..902219d705 100644 --- a/funcs/func_volume.c +++ b/funcs/func_volume.c @@ -206,7 +206,7 @@ static int volume_write(struct ast_channel *chan, const char *cmd, char *data, c if (!ast_strlen_zero(args.options)) { struct ast_flags flags = { 0 }; - ast_app_parse_options(volume_opts, &flags, &data, args.options); + ast_app_parse_options(volume_opts, &flags, NULL, args.options); vi->flags = flags.flags; } else { vi->flags = 0;