aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2006-05-17 00:36:53 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2006-05-17 00:36:53 +0000
commitcacf2b9638c2b9c32f03da60ca21d5a061927de7 (patch)
tree077d0f4bae94a58a98461aa831beab6f3474d6f5 /libgfortran
parentde1f8a0d82fe7a5067a2acd59410bddc3f542713 (diff)
downloadgcc-cacf2b9638c2b9c32f03da60ca21d5a061927de7.zip
gcc-cacf2b9638c2b9c32f03da60ca21d5a061927de7.tar.gz
gcc-cacf2b9638c2b9c32f03da60ca21d5a061927de7.tar.bz2
re PR libfortran/27575 (gfortran - does not generate error when trying to read too much data)
2006-05-16 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/27575 * io/transfer.c (read_block): Add check for end file condition. (read_block_direct): Add check for end file condition. From-SVN: r113837
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/transfer.c14
2 files changed, 20 insertions, 0 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index cb8c0fd..5b53e2b 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2006-05-16 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/27575
+ * io/transfer.c (read_block): Add check for end file condition.
+ (read_block_direct): Add check for end file condition.
+
2006-05-05 Francois-Xavier Coudert <coudert@clipper.ens.fr>
PR libfortran/26985
diff --git a/libgfortran/io/transfer.c b/libgfortran/io/transfer.c
index 43af8fb..054217d 100644
--- a/libgfortran/io/transfer.c
+++ b/libgfortran/io/transfer.c
@@ -272,6 +272,13 @@ read_block (st_parameter_dt *dtp, int *length)
}
}
+ if (dtp->u.p.current_unit->bytes_left == 0)
+ {
+ dtp->u.p.current_unit->endfile = AT_ENDFILE;
+ generate_error (&dtp->common, ERROR_END, NULL);
+ return;
+ }
+
*length = dtp->u.p.current_unit->bytes_left;
}
@@ -328,6 +335,13 @@ read_block_direct (st_parameter_dt *dtp, void *buf, size_t *nbytes)
}
}
+ if (dtp->u.p.current_unit->bytes_left == 0)
+ {
+ dtp->u.p.current_unit->endfile = AT_ENDFILE;
+ generate_error (&dtp->common, ERROR_END, NULL);
+ return;
+ }
+
*nbytes = dtp->u.p.current_unit->bytes_left;
}