Message ID | 56C3CEEE.4050305@charter.net |
---|---|
State | New |
Headers | show |
On 02/16/2016 05:37 PM, Jerry DeLisle wrote: > See patch to fix this below. > Committed on trunk, r233500 after regression testing, -fsanitize=address testing, and valgrind testing. Jerry
diff --git a/libgfortran/io/list_read.c b/libgfortran/io/list_read.c index fcd4b6e..bebdd8c 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;