[asterisk-bugs] [JIRA] (ASTERISK-27901) [patch] ooh323c: GCC 8: output truncated before terminating nul.
Alexander Traud (JIRA)
noreply at issues.asterisk.org
Thu Jun 7 07:09:54 CDT 2018
Alexander Traud created ASTERISK-27901:
------------------------------------------
Summary: [patch] ooh323c: GCC 8: output truncated before terminating nul.
Key: ASTERISK-27901
URL: https://issues.asterisk.org/jira/browse/ASTERISK-27901
Project: Asterisk
Issue Type: Bug
Security Level: None
Components: Addons/chan_ooh323
Affects Versions: 15.4.0, 13.21.0
Environment: GCC 8.1
Reporter: Alexander Traud
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}
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list