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: [email protected]
        ReportedBy: [EMAIL PROTECTED]


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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to