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

Asterisk Team (JIRA) noreply at issues.asterisk.org
Thu Dec 2 13:00:35 CST 2021


     [ https://issues.asterisk.org/jira/browse/ASTERISK-29711?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Asterisk Team updated ASTERISK-29711:
-------------------------------------

    Target Release Version/s: 19.1.0

> 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: 16.21.1, 18.7.1
>         Environment: Ubuntu 21.10
>            Reporter: Alexander Traud
>            Assignee: Sean Bright
>      Target Release: 16.23.0, 18.9.0, 19.1.0
>
>
> {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