This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug libfortran/52758] New: libgfortran/intrinsics/chmod.c: Array index out of bounds


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=52758

             Bug #: 52758
           Summary: libgfortran/intrinsics/chmod.c: Array index out of
                    bounds
    Classification: Unclassified
           Product: gcc
           Version: 4.8.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned@gcc.gnu.org
        ReportedBy: dcb314@hotmail.com


I just tried to analyse the source code of 
trunk 20120328 with static analysis tool cppcheck.

The cppcheck said

[libgfortran/intrinsics/chmod.c:144]: (error) Array 'rwxXstugo[9]' index 9 out
of bounds

Source code is

      rwxXstugo[9] = false;

but

  bool rwxXstugo[9];

I am surprised the usual gcc checks don't catch this.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]