Summary: | ASTERISK-27901: [patch] ooh323c: GCC 8: output truncated before terminating nul. | ||
Reporter: | Alexander Traud (traud) | Labels: | patch |
Date Opened: | 2018-06-07 07:09:16 | Date Closed: | 2018-06-07 15:00:13 |
Priority: | Major | Regression? | |
Status: | Closed/Complete | Components: | Addons/chan_ooh323 |
Versions: | 13.21.0 15.4.0 | Frequency of Occurrence | |
Related Issues: | |||
Environment: | GCC 8.1 | Attachments: | ( 0) gcc8_ooh323c.patch |
Description: | This is a follow-up to ASTERISK-27824. In Fedora 28, the compiler GCC 8.1.1 gives:{code}ooh323c/src/ooCapability.c: In function 'ooCapabilityCreateDTMFCapability':
ooh323c/src/ooCapability.c:815:7: error: 'strncpy' output truncated before terminating nul copying 4 bytes from a string of the same length [-Werror=stringop-truncation] strncpy(events, "0-16", strlen("0-16")); ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~{code}One approach is to go increase maximum number of characters by 1: {code}strncpy(events, "0-16", strlen("0-16")+1);{code}Another approach is to use strcpy:{code}strcpy(events, "0-16");{code} | ||
Comments: | By: Asterisk Team (asteriskteam) 2018-06-07 07:09:17.701-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. 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]. By: Friendly Automation (friendly-automation) 2018-06-07 15:00:14.986-0500 Change 9127 merged by Jenkins2: ooh323c: GCC 8.1 warned about output truncated before terminating nul. [https://gerrit.asterisk.org/9127|https://gerrit.asterisk.org/9127] By: Friendly Automation (friendly-automation) 2018-06-07 15:05:22.486-0500 Change 9126 merged by Jenkins2: ooh323c: GCC 8.1 warned about output truncated before terminating nul. [https://gerrit.asterisk.org/9126|https://gerrit.asterisk.org/9126] By: Friendly Automation (friendly-automation) 2018-06-07 16:15:14.308-0500 Change 9128 merged by Jenkins2: ooh323c: GCC 8.1 warned about output truncated before terminating nul. [https://gerrit.asterisk.org/9128|https://gerrit.asterisk.org/9128] |