public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libfortran/34291]  New: Uninitialized variable is used in io/list_read.c which causes segfault
@ 2007-11-29 12:09 ek dot kato at gmail dot com
  2007-11-29 13:18 ` [Bug libfortran/34291] " ek dot kato at gmail dot com
                   ` (9 more replies)
  0 siblings, 10 replies; 11+ messages in thread
From: ek dot kato at gmail dot com @ 2007-11-29 12:09 UTC (permalink / raw)
  To: gcc-bugs

In next_char() of libgfortran/io/list_read.c, dtp->u.p.line_buffer_enabled is
not initialized properly and this may cause segfault while accessing
dtp->u.p.line_buffer[dtp->u.p.item_count] even dtp->u.p.linebuffer is NULL.  I
think it can be solved with initializing in namelist_read() as follows.

Tested with gcc version 4.3.0 20071129 (experimental) (GCC) on Mac OS X 10.4.11
intel.


Index: libgfortran/io/list_read.c
===================================================================
--- libgfortran/io/list_read.c  (revision 130508)
+++ libgfortran/io/list_read.c  (working copy)
@@ -2646,6 +2646,7 @@
   dtp->u.p.namelist_mode = 1;
   dtp->u.p.input_complete = 0;
   dtp->u.p.expanded_read = 0;
+  dtp->u.p.line_buffer_enabled = 0;

   dtp->u.p.eof_jump = &eof_jump;
   if (setjmp (eof_jump))


-- 
           Summary: Uninitialized variable is used in io/list_read.c which
                    causes segfault
           Product: gcc
           Version: 4.3.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libfortran
        AssignedTo: unassigned at gcc dot gnu dot org
        ReportedBy: ek dot kato at gmail dot com


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=34291


^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2007-11-30 23:22 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-11-29 12:09 [Bug libfortran/34291] New: Uninitialized variable is used in io/list_read.c which causes segfault ek dot kato at gmail dot com
2007-11-29 13:18 ` [Bug libfortran/34291] " ek dot kato at gmail dot com
2007-11-29 13:27 ` aldot at gcc dot gnu dot org
2007-11-29 15:01 ` burnus at gcc dot gnu dot org
2007-11-30  1:11 ` ek dot kato at gmail dot com
2007-11-30  2:39 ` ek dot kato at gmail dot com
2007-11-30  4:04 ` jvdelisle at gcc dot gnu dot org
2007-11-30  5:16 ` [Bug libfortran/34291] [4.3 Regression] Segfault in io/list_read.c handling of end conditions jvdelisle at gcc dot gnu dot org
2007-11-30 23:20 ` jvdelisle at gcc dot gnu dot org
2007-11-30 23:22 ` jvdelisle at gcc dot gnu dot org
2007-11-30 23:22 ` jvdelisle at gcc dot gnu dot org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).