From: Jerry DeLisle Date: Wed, 17 Feb 2016 16:48:57 +0000 (+0000) Subject: re PR libfortran/69651 ([6 Regession] Usage of unitialized pointer io/list_read.c) X-Git-Tag: basepoints/gcc-7~893 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=efea09f21b6a53247987de2428b963fd1ccd6789;p=thirdparty%2Fgcc.git re PR libfortran/69651 ([6 Regession] Usage of unitialized pointer io/list_read.c) 2016-02-17 Jerry DeLisle PR libgfortran/69651 * io/list_read.c (push_char4): Fix the pointer usage for xrealloc. From-SVN: r233500 --- diff --git a/libgfortran/ChangeLog b/libgfortran/ChangeLog index 5120a433f29b..436b598443aa 100644 --- a/libgfortran/ChangeLog +++ b/libgfortran/ChangeLog @@ -1,3 +1,8 @@ +2016-02-17 Jerry DeLisle + + PR libgfortran/69651 + * io/list_read.c (push_char4): Fix the pointer usage for xrealloc. + 2016-02-15 Jerry DeLisle PR libgfortran/69651 diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index fcd4b6e25e97..bebdd8cf3013 100644 --- a/libgfortran/io/list_read.c +++ b/libgfortran/io/list_read.c @@ -119,7 +119,10 @@ push_char4 (st_parameter_dt *dtp, int c) if (dtp->u.p.saved_used >= dtp->u.p.saved_length) { dtp->u.p.saved_length = 2 * dtp->u.p.saved_length; - p = xrealloc (p, dtp->u.p.saved_length * sizeof (gfc_char4_t)); + dtp->u.p.saved_string = + xrealloc (dtp->u.p.saved_string, + dtp->u.p.saved_length * sizeof (gfc_char4_t)); + p = (gfc_char4_t *) dtp->u.p.saved_string; } p[dtp->u.p.saved_used++] = c;