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

            Bug ID: 60324
           Summary: Handle arbitrarily long path names
           Product: gcc
           Version: unknown
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
          Assignee: unassigned at gcc dot gnu.org
          Reporter: jb at gcc dot gnu.org

libgfortran uses (stack allocated) arrays of size PATH_MAX or smaller in many
places, when creating a temporary path name with a trailing NULL from a Fortran
string. However, it's possible for the user to create longer paths, and most
libc functions and/or syscalls do support longer path names just fine. So
PATH_MAX isn't that useful; properly designed software should be able to deal
with arbitrarily long path names. 

Instead of using such temp arrays, we should instead allocate them on the heap,
limited in length only by the available memory. Thus, the current
unpack_filename() should be replaced with some kind of fc_strdup() (that is,
given a Fortran string, return a pointer to a heap allocated NULL terminated
duplicate).

Reply via email to