[Home]

Summary:ASTERISK-27577: [patch] chan_ooh323: Avoid typecasting an int to unsigned short.
Reporter:Alexander Traud (traud)Labels:patch
Date Opened:2018-01-12 04:00:12.000-0600Date Closed:2018-01-12 11:25:25.000-0600
Priority:TrivialRegression?
Status:Closed/CompleteComponents:Addons/chan_ooh323
Versions:13.19.0 15.2.0 Frequency of
Occurrence
Related
Issues:
is caused byASTERISK-27156 Asterisk won't compile on Fedora 26 with devmode enabled.
Environment:Attachments:( 0) truncation_clang_ooh323.patch
Description: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.
Comments:By: Friendly Automation (friendly-automation) 2018-01-12 11:25:26.325-0600

Change 7945 merged by Jenkins2:
chan_ooh323: Avoid typecasting an int to unsigned short.

[https://gerrit.asterisk.org/7945|https://gerrit.asterisk.org/7945]

By: Friendly Automation (friendly-automation) 2018-01-12 11:28:27.177-0600

Change 7947 merged by Jenkins2:
chan_ooh323: Avoid typecasting an int to unsigned short.

[https://gerrit.asterisk.org/7947|https://gerrit.asterisk.org/7947]

By: Friendly Automation (friendly-automation) 2018-01-12 11:33:20.861-0600

Change 7946 merged by Jenkins2:
chan_ooh323: Avoid typecasting an int to unsigned short.

[https://gerrit.asterisk.org/7946|https://gerrit.asterisk.org/7946]