]> git.ipfire.org Git - thirdparty/gcc.git/commitdiff
re PR libfortran/69651 ([6 Regession] Usage of unitialized pointer io/list_read.c)
authorJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 17 Feb 2016 16:48:57 +0000 (16:48 +0000)
committerJerry DeLisle <jvdelisle@gcc.gnu.org>
Wed, 17 Feb 2016 16:48:57 +0000 (16:48 +0000)
2016-02-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>

PR libgfortran/69651
* io/list_read.c (push_char4): Fix the pointer usage for xrealloc.

From-SVN: r233500

libgfortran/ChangeLog
libgfortran/io/list_read.c

index 5120a433f29bd562b15122bfc13fbd8a6184cf43..436b598443aaa38b164215837f6f0af2c7a2492a 100644 (file)
@@ -1,3 +1,8 @@
+2016-02-17  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
+
+       PR libgfortran/69651
+       * io/list_read.c (push_char4): Fix the pointer usage for xrealloc.
+
 2016-02-15  Jerry DeLisle  <jvdelisle@gcc.gnu.org>
 
        PR libgfortran/69651
index fcd4b6e25e97073ca7f2ed23b8eec9eb91c7bd52..bebdd8cf3013693f736bbbe769d9936708d502b1 100644 (file)
@@ -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;