[asterisk-bugs] [JIRA] (ASTERISK-27901) [patch] ooh323c: GCC 8: output truncated before terminating nul.

Friendly Automation (JIRA) noreply at issues.asterisk.org
Thu Jun 7 15:06:54 CDT 2018


    [ https://issues.asterisk.org/jira/browse/ASTERISK-27901?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=243739#comment-243739 ] 

Friendly Automation commented on ASTERISK-27901:
------------------------------------------------

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]

> [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: 13.21.0, 15.4.0
>         Environment: GCC 8.1
>            Reporter: Alexander Traud
>            Assignee: Alexander Traud
>              Labels: patch
>         Attachments: gcc8_ooh323c.patch
>
>
> 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