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
This commit is contained in:
Jerry DeLisle 2017-11-29 03:07:43 +00:00
parent db1475654b
commit b7c44c8fd2
2 changed files with 7 additions and 1 deletions

View File

@ -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

View File

@ -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