summaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
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;