[Home]

Summary:ASTERISK-29711: aelparse: GCC 11.2 found two maybe uninitialized
Reporter:Alexander Traud (traud)Labels:
Date Opened:2021-10-28 10:00:02Date Closed:2021-11-01 09:16:04
Priority:MinorRegression?
Status:Closed/CompleteComponents:Utilities/aelparse
Versions:16.21.1 18.7.1 Frequency of
Occurrence
Related
Issues:
is duplicated byASTERISK-29725 COMPILE_DOUBLE exposes issues in logger.c and channel.c with GCC 11.2
Environment:Ubuntu 21.10Attachments:
Description:{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.
Comments:By: Asterisk Team (asteriskteam) 2021-10-28 10:00:03.156-0500

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution. Please note that log messages and other files should not be sent to the Sangoma Asterisk Team unless explicitly asked for. All files should be placed on this issue in a sanitized fashion as needed.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

Please note that by submitting data, code, or documentation to Sangoma through JIRA, you accept the Terms of Use present at [https://www.asterisk.org/terms-of-use/|https://www.asterisk.org/terms-of-use/].

By: Friendly Automation (friendly-automation) 2021-11-01 09:16:05.505-0500

Change 16660 merged by Friendly Automation:
various: Fix GCC 11.2 compilation issues.

[https://gerrit.asterisk.org/c/asterisk/+/16660|https://gerrit.asterisk.org/c/asterisk/+/16660]

By: Friendly Automation (friendly-automation) 2021-11-01 09:16:38.920-0500

Change 16658 merged by Friendly Automation:
various: Fix GCC 11.2 compilation issues.

[https://gerrit.asterisk.org/c/asterisk/+/16658|https://gerrit.asterisk.org/c/asterisk/+/16658]

By: Friendly Automation (friendly-automation) 2021-11-01 09:18:32.062-0500

Change 16659 merged by Friendly Automation:
various: Fix GCC 11.2 compilation issues.

[https://gerrit.asterisk.org/c/asterisk/+/16659|https://gerrit.asterisk.org/c/asterisk/+/16659]

By: Friendly Automation (friendly-automation) 2021-11-01 09:19:25.626-0500

Change 16663 merged by Friendly Automation:
various: Fix GCC 11.2 compilation issues.

[https://gerrit.asterisk.org/c/asterisk/+/16663|https://gerrit.asterisk.org/c/asterisk/+/16663]