[Bug libfortran/34291] Uninitialized variable is used in io/list_read.c which causes segfault

ek dot kato at gmail dot com gcc-bugzilla@gcc.gnu.org
Thu Nov 29 13:18:00 GMT 2007

------- Comment #1 from ek dot kato at gmail dot com  2007-11-29 13:18 -------
It turns out that my explanation and assumption about uninitialization was
wrong, but the real cause of the segmentation fault is that some functions call
free_line(dtp) without resetting line_buffer_enabled.  Here is the revised
patch to avoid crash.

Index: list_read.c
--- list_read.c (revision 130508)
+++ list_read.c (working copy)
@@ -125,6 +125,7 @@

   free_mem (dtp->u.p.line_buffer);
   dtp->u.p.line_buffer = NULL;
+  dtp->u.p.line_buffer_enabled = 0;



More information about the Gcc-bugs mailing list