[asterisk-bugs] [JIRA] Created: (PRI-145) Unchecked write in pritest

Tzafrir Cohen (JIRA) noreply at issues.asterisk.org
Wed Oct 10 13:16:27 CDT 2012


Unchecked write in pritest
--------------------------

                 Key: PRI-145
                 URL: https://issues.asterisk.org/jira/browse/PRI-145
             Project: LibPRI
          Issue Type: Bug
      Security Level: None
          Components: General
    Affects Versions: 1.4.13
         Environment: Debian 7.0 (Wheezy)
            Reporter: Tzafrir Cohen
            Assignee: Richard Mudgett
            Severity: Minor
         Attachments: fix_unused_write.patch

Building libpri with the right build flags fails:

gcc -g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -Wall -Werror -Wstrict-prototypes -Wmissing-prototypes -fPIC  -O2  -MD -MT pritest.o -MF .pritest.o.d -MP -c -o pritest.o pritest.c
pritest.c: In function 'do_channel':
pritest.c:71:8: error: ignoring return value of 'write', declared with attribute warn_unused_result [-Werror=unused-result]

Attached a patch to check the output of write(2) and exit the main loop of pri_test in case of a failed write.



--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira



More information about the asterisk-bugs mailing list