aboutsummaryrefslogtreecommitdiff
path: root/libgfortran
diff options
context:
space:
mode:
authorJerry DeLisle <jvdelisle@gcc.gnu.org>2017-11-29 03:07:43 +0000
committerJerry DeLisle <jvdelisle@gcc.gnu.org>2017-11-29 03:07:43 +0000
commitb7c44c8fd26941ef5aa419fa3862b5a2c4e02c13 (patch)
tree3332c8088f592b15a07ed0d4c6a13da0c777a61f /libgfortran
parentdb1475654bf99c05a3b6e0ff5162e17167740fa3 (diff)
downloadgcc-b7c44c8fd26941ef5aa419fa3862b5a2c4e02c13.zip
gcc-b7c44c8fd26941ef5aa419fa3862b5a2c4e02c13.tar.gz
gcc-b7c44c8fd26941ef5aa419fa3862b5a2c4e02c13.tar.bz2
re PR libfortran/83168 (FAIL: gfortran.dg/fmt_f0_2.f90 with a sanitized libgfortran)
2017-11-28 Jerry DeLisle <jvdelisle@gcc.gnu.org> PR libgfortran/83168 * io/write.c (select_string): Bump size by one to avoid overrun. From-SVN: r255225
Diffstat (limited to 'libgfortran')
-rw-r--r--libgfortran/ChangeLog6
-rw-r--r--libgfortran/io/write.c2
2 files changed, 7 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog
index 6940f79..251e6b4 100644
--- a/libgfortran/ChangeLog
+++ b/libgfortran/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-28 Jerry DeLisle <jvdelisle@gcc.gnu.org>
+
+ PR libgfortran/83168
+ * io/write.c (select_string): Bump size by one to avoid
+ overrun.
+
2017-11-24 Janne Blomqvist <jb@gcc.gnu.org>
PR fortran/36313
diff --git a/libgfortran/io/write.c b/libgfortran/io/write.c
index f417202..582d196 100644
--- a/libgfortran/io/write.c
+++ b/libgfortran/io/write.c
@@ -1552,7 +1552,7 @@ select_string (st_parameter_dt *dtp, const fnode *f, char *buf, size_t *size,
int kind)
{
char *result;
- *size = size_from_kind (dtp, f, kind) + f->u.real.d;
+ *size = size_from_kind (dtp, f, kind) + f->u.real.d + 1;
if (*size > BUF_STACK_SZ)
result = xmalloc (*size);
else