]> git.ipfire.org Git - thirdparty/gcc.git/commit
PR fortran/95104 - Segfault on a legal WAIT statement
authorHarald Anlauf <anlauf@gmx.de>
Tue, 26 May 2020 21:29:52 +0000 (23:29 +0200)
committerHarald Anlauf <anlauf@gmx.de>
Wed, 27 May 2020 19:05:41 +0000 (21:05 +0200)
commit50cd4503e59f29e379d0515c48e67d0658ee4562
treef44d1a982feef9d7fa54e4d670dec2ca73a7c4b1
parenta6deb68d01316055072b8856185da4eaf77836d1
PR fortran/95104 - Segfault on a legal WAIT statement

Referencing a unit in a WAIT statement that has not been opened before
resulted in a NULL pointer dereference.  Check for this condition.

2020-05-26  Harald Anlauf  <anlauf@gmx.de>

libgfortran/
PR libfortran/95104
* io/transfer.c (st_wait_async): Do not dereference NULL pointer.

gcc/testsuite/
PR libfortran/95104
* gfortran.dg/pr95104.f90: New test.

Co-Authored-By: Steven G. Kargl <kargl@gcc.gnu.org>
(cherry picked from commit 56f03cd12be26828788a27f6f3c250041a958e45)
gcc/testsuite/gfortran.dg/pr95104.f90 [new file with mode: 0644]
libgfortran/io/transfer.c