PR libfortran/64770 Segfault when trying to open existing file with status="new".
libgfortran ChangeLog: 2015-01-24 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/64770 * io/unit.c (filename_from_unit): Check that u->filename != NULL before calling strdup. testsuite ChangeLog: 2015-01-24 Janne Blomqvist <jb@gcc.gnu.org> PR libfortran/64770 * gfortran.dg/open_new_segv.f90: New test. From-SVN: r220086
This commit is contained in:
parent
d773ed85c5
commit
7165d8f191
@ -1,3 +1,8 @@
|
||||
2015-01-24 Janne Blomqvist <jb@gcc.gnu.org>
|
||||
|
||||
PR libfortran/64770
|
||||
* gfortran.dg/open_new_segv.f90: New test.
|
||||
|
||||
2015-01-24 Oleg Endo <olegendo@gcc.gnu.org>
|
||||
|
||||
PR target/49263
|
||||
|
10
gcc/testsuite/gfortran.dg/open_new_segv.f90
Normal file
10
gcc/testsuite/gfortran.dg/open_new_segv.f90
Normal file
@ -0,0 +1,10 @@
|
||||
! { dg-do run }
|
||||
! PR 64770 SIGSEGV when trying to open an existing file with status="new"
|
||||
program pr64770
|
||||
implicit none
|
||||
! Make sure pr64770test.dat exists
|
||||
open(99, file="pr64770test.dat", status="replace")
|
||||
close(99)
|
||||
open(99, file="pr64770test.dat", access="stream", form="unformatted", &
|
||||
status="new")
|
||||
end program pr64770
|
@ -1,3 +1,9 @@
|
||||
2015-01-24 Janne Blomqvist <jb@gcc.gnu.org>
|
||||
|
||||
PR libfortran/64770
|
||||
* io/unit.c (filename_from_unit): Check that u->filename != NULL
|
||||
before calling strdup.
|
||||
|
||||
2015-01-22 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
PR libgfortran/61933
|
||||
|
@ -829,7 +829,7 @@ filename_from_unit (int n)
|
||||
}
|
||||
|
||||
/* Get the filename. */
|
||||
if (u != NULL)
|
||||
if (u != NULL && u->filename != NULL)
|
||||
return strdup (u->filename);
|
||||
else
|
||||
return (char *) NULL;
|
||||
|
Loading…
Reference in New Issue
Block a user