diff options
author | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2017-11-29 03:07:43 +0000 |
---|---|---|
committer | Jerry DeLisle <jvdelisle@gcc.gnu.org> | 2017-11-29 03:07:43 +0000 |
commit | b7c44c8fd26941ef5aa419fa3862b5a2c4e02c13 (patch) | |
tree | 3332c8088f592b15a07ed0d4c6a13da0c777a61f /libgfortran | |
parent | db1475654bf99c05a3b6e0ff5162e17167740fa3 (diff) | |
download | gcc-b7c44c8fd26941ef5aa419fa3862b5a2c4e02c13.tar.gz |
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/ChangeLog | 6 | ||||
-rw-r--r-- | libgfortran/io/write.c | 2 |
2 files changed, 7 insertions, 1 deletions
diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 6940f790b5c..251e6b4c462 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 f4172029c0e..582d196c4e3 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 |