[asterisk-bugs] [JIRA] (ASTERISK-29711) aelparse: GCC 11.2 found two maybe uninitialized

Alexander Traud (JIRA) noreply at issues.asterisk.org
Thu Oct 28 10:00:49 CDT 2021


Alexander Traud created ASTERISK-29711:
------------------------------------------

             Summary: aelparse: GCC 11.2 found two maybe uninitialized
                 Key: ASTERISK-29711
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-29711
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Utilities/aelparse
    Affects Versions: 18.7.1, 16.21.1
         Environment: Ubuntu 21.10
            Reporter: Alexander Traud


{code}   [CC] extconf.c -> extconf.o
extconf.c: In function ‘ast_config_internal_load’:
extconf.c:2896:18: warning: ‘db’ may be used uninitialized [-Wmaybe-uninitialized]
 2896 |         result = loader->load_func(db, table, filename, cfg, withcomments, suggested_incl_file);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extconf.c:2896:18: note: by argument 1 of type ‘const char *’ to ‘config_load_func’ {aka ‘struct ast_config *(const char *, const char *, const char *, struct ast_config *, int,  const char *)’}
extconf.c:2866:14: note: ‘db’ declared here
 2866 |         char db[256];
      |              ^~
extconf.c:2896:18: warning: ‘table’ may be used uninitialized [-Wmaybe-uninitialized]
 2896 |         result = loader->load_func(db, table, filename, cfg, withcomments, suggested_incl_file);
      |                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
extconf.c:2896:18: note: by argument 2 of type ‘const char *’ to ‘config_load_func’ {aka ‘struct ast_config *(const char *, const char *, const char *, struct ast_config *, int,  const char *)’}
extconf.c:2867:14: note: ‘table’ declared here
 2867 |         char table[256];
      |              ^~~~~
{code}
I do not think the solution is initializing the variables {{db}} and {{table}} because I do not know what happens if those are {{NULL}} either. Perhaps someone knows what that code does, I do not understand it to be able to change the control flow. Therefore, just reporting.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list