You are viewing a plain text version of this content. The canonical link for it is here.
Posted to bugs@httpd.apache.org by bu...@apache.org on 2008/05/28 06:58:34 UTC

DO NOT REPLY [Bug 45084] New: A potential bug discovered by static program analysis

https://issues.apache.org/bugzilla/show_bug.cgi?id=45084

           Summary: A potential bug discovered by static program analysis
           Product: Apache httpd-2
           Version: 2.2.8
          Platform: PC
        OS/Version: Windows XP
            Status: NEW
          Severity: normal
          Priority: P3
         Component: Core
        AssignedTo: bugs@httpd.apache.org
        ReportedBy: rxc92@case.edu


File Name: /scrlib/apr/file_io/unix/seek.c
Function Nam: apr_file_trunc()
Correct Code: 

    99: apr_status_t apr_file_trunc(apr_file_t *fp, apr_off_t offset)
   100: {
   101:     if (ftruncate(fp->filedes, offset) == -1) {
   102:         return errno;
   103:     }
   104:     return apr_file_seek(fp, APR_SET, &offset);

File Name: /src/rotatelogs.c
Function Nam: main()
Buggy Code: 

   263:     apr_file_trunc(nLogFD, 0);
   284:     apr_file_trunc(nLogFD, 0);

File Name: /src/testbuckets.c
Function Nam: test_insertfile()
Buggy Code: 

   355:     apr_file_trunc(f, 0);
   419:     apr_file_trunc(f, 0);


Description: A rule discovered by our static program analysis approach
indicates that an error occurs if apr_file_seek() outputs “!APR_SUCCESS”.
The function apr_file_trunc() returns the value outputted by apr_file_seek()
directly. Thus, it is inferred that an error occurs if apr_file_trunc() returns
“!APR_SUCCESS”. However, the outputs of apr_file_trunc() are not checked in
the above code.


-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.
---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


[Bug 45084] failure to check return value of apr_file_trunc

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45084

Joe Orton <jo...@redhat.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #1 from Joe Orton <jo...@redhat.com> ---
Some of this was already fixed on trunk, remaining case done in r1374247.

Thanks for the report.

-- 
You are receiving this mail because:
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org


DO NOT REPLY [Bug 45084] failure to check return value of apr_file_trunc

Posted by bu...@apache.org.
https://issues.apache.org/bugzilla/show_bug.cgi?id=45084


Nick Kew <ni...@webthing.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |minor
          Component|Core                        |support
         OS/Version|Windows XP                  |All
           Platform|PC                          |All
            Summary|A potential bug discovered  |failure to check return
                   |by static program analysis  |value of apr_file_trunc




-- 
Configure bugmail: https://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.

---------------------------------------------------------------------
To unsubscribe, e-mail: bugs-unsubscribe@httpd.apache.org
For additional commands, e-mail: bugs-help@httpd.apache.org