From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 14745 invoked by alias); 29 Nov 2007 13:18:46 -0000 Received: (qmail 14707 invoked by uid 48); 29 Nov 2007 13:18:34 -0000 Date: Thu, 29 Nov 2007 13:18:00 -0000 Message-ID: <20071129131834.14706.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug libfortran/34291] Uninitialized variable is used in io/list_read.c which causes segfault In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "ek dot kato at gmail dot com" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-11/txt/msg02952.txt.bz2 ------- 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