[asterisk-bugs] [JIRA] (ASTERISK-27578) [patch] app_osplookup.c: Avoid a format truncation.

Alexander Traud (JIRA) noreply at issues.asterisk.org
Fri Jan 12 04:22:39 CST 2018


Alexander Traud created ASTERISK-27578:
------------------------------------------

             Summary: [patch] app_osplookup.c: Avoid a format truncation.
                 Key: ASTERISK-27578
                 URL: https://issues.asterisk.org/jira/browse/ASTERISK-27578
             Project: Asterisk
          Issue Type: Bug
      Security Level: None
          Components: Applications/app_osplookup
    Affects Versions: 15.2.0, 13.19.0
            Reporter: Alexander Traud
            Severity: Trivial
         Attachments: truncation_gcc_osplookup.patch

The compiler _GCC_ (7.2) reports:{code}app_osplookup.c: In function 'osplookup_exec':
app_osplookup.c:2584:42: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4078 [-Wformat-truncation=]
    snprintf(buffer, sizeof(buffer), "%s: %s", OSP_SIP_HEADER, results.token);
                                          ^~                   ~~~~~~~
app_osplookup.c: In function 'ospnext_exec':
app_osplookup.c:2770:42: warning: '%s' directive output may be truncated writing up to 4095 bytes into a region of size 4078 [-Wformat-truncation=]
    snprintf(buffer, sizeof(buffer), "%s: %s", OSP_SIP_HEADER, results.token);
                                          ^~                   ~~~~~~~{code}ASTERISK-27156 tried to fix all warning reported by GCC 7.0 (and newer) but missed this module, because it depends on the package _libosptk-dev_, which is available only since Ubuntu 17.04, for example. Consequently, the above issue would emerge when going for script {{install_prereq}} on the upcoming Ubuntu 18.04 LTS.

For us external project members, covering the whole source code of Asterisk including all optional and conditional code is more than complicated. Perhaps one day, the Asterisk team is able to find a solution to identify issues with new compiler (versions) more systematically.



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



More information about the asterisk-bugs mailing list