+2004-06-19 Bud Davis <bdavis9659@comcast.net>
+
+ PR gfortran/16080
+ * gfortran.fortran-torture/execute/read_null_string.f90: New file.
+
2004-06-19 Andrew Pinski <pinskia@physics.uc.edu>
* g++.dg/lookup/crash3.C: Use __SIZE_TYPE__
--- /dev/null
+! pr 16080, segfault on reading an empty string
+ implicit none
+ integer t
+ character*20 temp_name
+ character*2 quotes
+ open(unit=7,status='SCRATCH')
+ quotes = '""""' ! "" in the file
+ write(7,*)1
+ write(7,'(A)')quotes
+ temp_name = 'hello' ! make sure the read overwrites it
+ rewind(7)
+ read(7, *) t
+ read(7, *) temp_name
+ if (temp_name.ne.'') call abort
+ end
+2004-06-19 Bud Davis <bdavis9659@comcast.net>
+
+ PR gfortran/16080
+ * io/list_read.c(set_value): don't copy if the string is null.
+
2004-06-14 Bud Davis <bdavis9659@comcast.net>
PR gfortran/15292
break;
case BT_CHARACTER:
- m = (len < saved_used) ? len : saved_used;
- memcpy (p, saved_string, m);
+ if (saved_string)
+ {
+ m = (len < saved_used) ? len : saved_used;
+ memcpy (p, saved_string, m);
+ }
+ else /* just delimeters encountered, nothing to copy but SPACE */
+ m = 0;
if (m < len)
memset (((char *) p) + m, ' ', len - m);