This is the mail archive of the
gcc-bugs@gcc.gnu.org
mailing list for the GCC project.
[Bug libfortran/34291] Uninitialized variable is used in io/list_read.c which causes segfault
- From: "ek dot kato at gmail dot com" <gcc-bugzilla at gcc dot gnu dot org>
- To: gcc-bugs at gcc dot gnu dot org
- Date: 29 Nov 2007 13:18:34 -0000
- Subject: [Bug libfortran/34291] Uninitialized variable is used in io/list_read.c which causes segfault
- References: <bug-34291-15446@http.gcc.gnu.org/bugzilla/>
- Reply-to: gcc-bugzilla at gcc dot gnu dot org
------- 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;
}
--
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34291