From: Jerry DeLisle Date: Wed, 29 Nov 2017 03:07:43 +0000 (+0000) Subject: re PR libfortran/83168 (FAIL: gfortran.dg/fmt_f0_2.f90 with a sanitized libgfortran) X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b7c44c8fd26941ef5aa419fa3862b5a2c4e02c13;p=gcc.git re PR libfortran/83168 (FAIL: gfortran.dg/fmt_f0_2.f90 with a sanitized libgfortran) 2017-11-28 Jerry DeLisle PR libgfortran/83168 * io/write.c (select_string): Bump size by one to avoid overrun. From-SVN: r255225 --- 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 + + PR libgfortran/83168 + * io/write.c (select_string): Bump size by one to avoid + overrun. + 2017-11-24 Janne Blomqvist 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