]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Coverity Report: Fix issues for error type UNINIT in Core supported modules
authorJonathan Rose <jrose@digium.com>
Thu, 10 May 2012 15:43:06 +0000 (15:43 +0000)
committerJonathan Rose <jrose@digium.com>
Thu, 10 May 2012 15:43:06 +0000 (15:43 +0000)
(issue ASTERISK-19652)
Reported by: Matt Jordan
Review: https://reviewboard.asterisk.org/r/1909/
........

Merged revisions 366048 from http://svn.asterisk.org/svn/asterisk/branches/1.8

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/10@366049 65c4cc65-6c06-0410-ace0-fbb531ad65f3

apps/app_chanspy.c
apps/app_disa.c
apps/app_page.c
funcs/func_cdr.c
main/features.c

index 5006492771a9e51b9eac4df0fc18bd299d174b56..d2c86eeca14345ce65a129e1ed18215f7e01ed23 100644 (file)
@@ -1255,6 +1255,7 @@ static int extenspy_exec(struct ast_channel *chan, const char *data)
                }
 
        } else {
+               /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
                ast_clear_flag(&flags, AST_FLAGS_ALL);
        }
 
@@ -1299,6 +1300,7 @@ static int dahdiscan_exec(struct ast_channel *chan, const char *data)
        int res;
        char *mygroup = NULL;
 
+       /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
        ast_clear_flag(&flags, AST_FLAGS_ALL);
        ast_format_clear(&oldwf);
        if (!ast_strlen_zero(data)) {
index 3ca08000963771d674f643fed443f2206e9cd6d5..c3aa8976c24862627a49e8f024945961b6fa6b0c 100644 (file)
@@ -181,8 +181,13 @@ static int disa_exec(struct ast_channel *chan, const char *data)
                args.context = "disa";
        if (ast_strlen_zero(args.mailbox))
                args.mailbox = "";
-       if (!ast_strlen_zero(args.options))
+       if (!ast_strlen_zero(args.options)) {
                ast_app_parse_options(app_opts, &flags, NULL, args.options);
+       } else {
+               /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
+               ast_clear_flag(&flags, AST_FLAGS_ALL);
+       }
+
 
        ast_debug(1, "Mailbox: %s\n",args.mailbox);
 
index 40b102da7190944af6fe7771aa9fdc412d07bfa0..9908bcbcd21cf14981141d20b8fdb100707b1101 100644 (file)
@@ -177,6 +177,11 @@ static int page_exec(struct ast_channel *chan, const char *data)
 
        if (!ast_strlen_zero(args.options)) {
                ast_app_parse_options(page_opts, &flags, opts, args.options);
+       } else {
+               /* opts must be initialized if there wasn't an options string. */
+               for (i = 0; i < OPT_ARG_ARRAY_SIZE; i++) {
+                       opts[i] = NULL;
+               }
        }
 
        if (!ast_strlen_zero(args.timeout)) {
index 25e10a2fa4340a6dac49c6b28ca3169e9c5bc9ec..0e025c0584ad0260238b941e74e388b8d8f86d0b 100644 (file)
@@ -197,7 +197,7 @@ AST_APP_OPTIONS(cdr_func_options, {
 static int cdr_read(struct ast_channel *chan, const char *cmd, char *parse,
                    char *buf, size_t len)
 {
-       char *ret;
+       char *ret = NULL;
        struct ast_flags flags = { 0 };
        struct ast_cdr *cdr;
        AST_DECLARE_APP_ARGS(args,
index 97dd10fd8d8fb1843a213d06748f259f3596af79..89f4ec998271609d41a2ecf6856cbf30286601d0 100644 (file)
@@ -3345,9 +3345,11 @@ static int feature_interpret(struct ast_channel *chan, struct ast_channel *peer,
        struct ast_flags features;
        struct ast_call_feature feature;
        if (sense == FEATURE_SENSE_CHAN) {
+               /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
                ast_copy_flags(&features, &(config->features_caller), AST_FLAGS_ALL);
        }
        else {
+               /* Coverity - This uninit_use should be ignored since this macro initializes the flags */
                ast_copy_flags(&features, &(config->features_callee), AST_FLAGS_ALL);
        }