[asterisk-bugs] [JIRA] (ASTERISK-27577) [patch] chan_ooh323: Avoid typecasting an int to unsigned short.

Asterisk Team (JIRA) noreply at issues.asterisk.org
Wed Aug 8 10:14:59 CDT 2018


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

Asterisk Team updated ASTERISK-27577:
-------------------------------------

    Target Release Version/s: 16.0.0

> [patch] chan_ooh323: Avoid typecasting an int to unsigned short.
> ----------------------------------------------------------------
>
>                 Key: ASTERISK-27577
>                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27577
>             Project: Asterisk
>          Issue Type: Bug
>      Security Level: None
>          Components: Addons/chan_ooh323
>    Affects Versions: 13.19.0, 15.2.0
>            Reporter: Alexander Traud
>            Assignee: Alexander Traud
>            Severity: Trivial
>              Labels: patch
>      Target Release: 13.20.0, 15.3.0, 16.0.0
>
>         Attachments: truncation_clang_ooh323.patch
>
>
> The compiler _clang_ (5.0.1) reports:{code}chan_ooh323.c:3215:40: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
>                 sprintf(ip_port, "%s:%hu", peer->ip, peer->port);
>                                      ~~~             ^~~~~~~~~~
>                                      %d
> /usr/include/x86_64-linux-gnu/bits/stdio2.h:39:7: note: expanded from macro 'sprintf'
>                            __VA_ARGS__)
>                            ^~~~~~~~~~~
> chan_ooh323.c:3306:58: warning: format specifies type 'unsigned short' but the argument has type 'int' [-Wformat]
>                 snprintf(ip_port, sizeof(ip_port), "%s:%hu", peer->ip, peer->port);
>                                                        ~~~             ^~~~~~~~~~
>                                                        %d
> {code}This issue is caused by the fix for ASTERISK-27156. Because the array _ip_port_ was already increased enough, this change was not needed actually. Therefore, it is simply a partly revert. In other words: The compiler _gcc_ does warn even after reverting this.



--
This message was sent by Atlassian JIRA
(v6.2#6252)



More information about the asterisk-bugs mailing list