This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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



------- 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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]