transfer.c (read_sf): Check if readlen was less than the requested number of bytes to read and if so...
2007-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org> * io/transfer.c (read_sf): Check if readlen was less than the requested number of bytes to read and if so, generate error. From-SVN: r131177
This commit is contained in:
parent
2e39477a23
commit
f15db427e1
|
@ -1,3 +1,8 @@
|
|||
2007-12-25 Jerry DeLisle <jvdelisle@gcc.gnu.org>
|
||||
|
||||
* io/transfer.c (read_sf): Check if readlen was less than the requested
|
||||
number of bytes to read and if so, generate error.
|
||||
|
||||
2007-12-25 Daniel Franke <franke.daniel@gmail.com>
|
||||
|
||||
PR fortran/34533
|
||||
|
|
|
@ -166,7 +166,14 @@ read_sf (st_parameter_dt *dtp, int *length, int no_error)
|
|||
{
|
||||
readlen = *length;
|
||||
q = salloc_r (dtp->u.p.current_unit->s, &readlen);
|
||||
memcpy (p, q, readlen);
|
||||
if (readlen < *length)
|
||||
{
|
||||
generate_error (&dtp->common, LIBERROR_END, NULL);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if (q != NULL)
|
||||
memcpy (p, q, readlen);
|
||||
goto done;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue