From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 20695 invoked by alias); 15 Feb 2016 22:16:45 -0000 Mailing-List: contact fortran-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: fortran-owner@gcc.gnu.org Received: (qmail 20666 invoked by uid 89); 15 Feb 2016 22:16:43 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.3 required=5.0 tests=AWL,BAYES_00,FREEMAIL_FROM,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=Hx-languages-length:1596, H*f:sk:56C246E, jvdelisle@charter.net, H*i:sk:56C246E X-Spam-User: qpsmtpd, 2 recipients X-HELO: mail-wm0-f52.google.com Received: from mail-wm0-f52.google.com (HELO mail-wm0-f52.google.com) (74.125.82.52) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-GCM-SHA256 encrypted) ESMTPS; Mon, 15 Feb 2016 22:16:42 +0000 Received: by mail-wm0-f52.google.com with SMTP id a4so74377588wme.1; Mon, 15 Feb 2016 14:16:42 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:date :message-id:subject:from:to:cc:content-type; bh=j0u7btQQbvUEfVLFLOE0nevJIezsqZbu7efHB3S2cn0=; b=Ad5eUS/OwgYUujispnvGJJonJ+CtfkaLURdALPnRuRUY7yJDeGheGc0umCJWpILlMA G8TaQfca6Tfk76fFt53+nXQ+4koPdrVbiAMjM7BS3a0+9m0C5SSleY33h/6dLaGQtEhy gacQeTrynJzj+4TlTYVmO0pYWvW7enmr3b3XCHbSuEI0+/6Cd6PGB/svkx9Iye01/RFp wWDV+ScE6dvmUZl7nPPyGQ/dyQCe29eMn5TKYpvJE2loTa1NHX3i10mxFrhgUCyxMWcs AXLpPJUDQ7tS2AtVCporZnRXzkbzFT/IgJHMXkb/btnsAzfTAZvzShXfVjD0TIxDTp+4 HGsA== X-Gm-Message-State: AG10YOT76M/nL9e9KZGbvzL9KT9DvPYrLWSlRZsZDjC1CdjzLOLct5VYtWmHS1dS2dc20egcKwatDWTf1eZbLA== MIME-Version: 1.0 X-Received: by 10.194.77.167 with SMTP id t7mr17841501wjw.90.1455574599621; Mon, 15 Feb 2016 14:16:39 -0800 (PST) Received: by 10.194.178.74 with HTTP; Mon, 15 Feb 2016 14:16:39 -0800 (PST) In-Reply-To: <56C246EB.4050104@charter.net> References: <56C246EB.4050104@charter.net> Date: Mon, 15 Feb 2016 22:16:00 -0000 Message-ID: Subject: Re: [6 Regession] Usage of unitialized pointer io/list_read.c ( From: Janne Blomqvist To: Jerry DeLisle Cc: gfortran , gcc patches Content-Type: text/plain; charset=UTF-8 X-IsSubscribed: yes X-SW-Source: 2016-02/txt/msg00057.txt.bz2 On Mon, Feb 15, 2016 at 11:45 PM, Jerry DeLisle wrote: > The title of the PR should be "Mishandling of namelist comments" or > "Interpreting '!' as a comment in non-namelist reads". > > The attached patch fixes the regression by reverting the previous attempt at > namelist comments that used only CASE_SEPARATOR to enable comments in namelists. > The approach now is to test specifically for '!' in each type of read various > functions. If in namelist mode the respective case falls through to the handling > of separators which eats the line when a '!' is found. Otherwise, the read is > determined to be bad and an error is issued. > > Since the reporter of this PR noticed something screwy with the 'new' pointer in > push_char4, I took a close look at the code and deleted it. I also heavily > instrumented and tested this mechanism to grow the buffer and deleted the use of > memset which was commented to not be needed. The 'new' was not being initialized > and I think was a leftover from a previous edit and just missed. > > I added two new test cases in the patch. These test all the new error > conditions. Also, read_bang4.f90 uses a large kind=4 string to exercise the > buffer mechanism. Verification is through making sure what we read in matches > what we wrote out to the test scratch file > > Regression tested on x86_64-Linux. OK for trunk? any thoughts on back porting > to 5 since it fixes a potentially bad pointer problem in push_char4? Ok for both trunk and 5. -- Janne Blomqvist