summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-28 21:14:02 +0000
committerbdavis <bdavis@138bc75d-0d04-0410-961f-82ee72b054a4>2004-11-28 21:14:02 +0000
commit8ff470b4b56aa611157272c824899b07df46a992 (patch)
tree89d7f6bc7734d8a3ecf12aac0f4cbe7e31547a34 /libgfortran
parent077ef55d04ad8c4f0fbbb9ab7c3594e509bedd29 (diff)
downloadgcc-8ff470b4b56aa611157272c824899b07df46a992.tar.gz
2004-11-28 Bud Davis <bdavis9659@comcast.net>
* gcc/gcc/gfortran.dg/direct_io_2.f90: New test. * gcc/libgfortran/io/unix.c (mmap_alloc_w_a): check for a write to a location less than the mapped area. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@91426 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog5
-rw-r--r--libgfortran/io/unix.c3
2 files changed, 7 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index a27c75d77d5..761ec22886d 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,8 @@
+2004-11-28 Bud Davis <bdavis9659@comcast.net>
+
+ * io/unix.c (mmap_alloc_w_a): check for a write to a location
+ less than the mapped area.
+
2004-11-27 Bud Davis <bdavis9659@comcast.net>
PR fortran/18364
diff --git a/libgfortran/io/unix.c b/libgfortran/io/unix.c
index 45d8cfd633f..2e9d9a4ba8c 100644
--- a/libgfortran/io/unix.c
+++ b/libgfortran/io/unix.c
@@ -667,7 +667,8 @@ mmap_alloc_w_at (unix_stream * s, int *len, gfc_offset where)
}
if ((s->buffer == NULL || s->buffer_offset > where ||
- where + *len > s->buffer_offset + s->active) &&
+ where + *len > s->buffer_offset + s->active ||
+ where < s->buffer_offset + s->active) &&
mmap_alloc (s, where, len) == FAILURE)
return NULL;