From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 125479 invoked by alias); 18 Oct 2018 21:40:11 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Received: (qmail 124941 invoked by uid 89); 18 Oct 2018 21:40:10 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=0.4 required=5.0 tests=BAYES_00,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,TRACKER_ID autolearn=no version=3.3.2 spammy= X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 18 Oct 2018 21:40:09 +0000 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4001230C9EF2; Thu, 18 Oct 2018 21:40:08 +0000 (UTC) Received: from localhost (unused-10-15-17-196.yyz.redhat.com [10.15.17.196]) by smtp.corp.redhat.com (Postfix) with ESMTP id 120877AB66; Thu, 18 Oct 2018 21:40:08 +0000 (UTC) From: Sergio Durigan Junior To: Tom Tromey Cc: GDB Patches Subject: Re: [PATCH] Fix PR cli/23785: Check if file exists when invoking "restore FILE binary" References: <20181018170051.15851-1-sergiodj@redhat.com> <878t2var9d.fsf@tromey.com> Date: Thu, 18 Oct 2018 21:40:00 -0000 In-Reply-To: <878t2var9d.fsf@tromey.com> (Tom Tromey's message of "Thu, 18 Oct 2018 15:17:50 -0600") Message-ID: <87sh13vsqw.fsf@redhat.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-IsSubscribed: yes X-SW-Source: 2018-10/txt/msg00405.txt.bz2 On Thursday, October 18 2018, Tom Tromey wrote: >>>>>> "Sergio" == Sergio Durigan Junior writes: > > Sergio> This simple patch fixes the segfault reported on PR cli/23785, which > Sergio> happens when using the "restore FILE binary" command with a > Sergio> non-existent file. We just have to check if the file handler returned > Sergio> by "gdb_fopen_cloexec" is not NULL, and error out if it is. > > Sergio> A test has also been added to gdb.base/restore.exp in order to > Sergio> exercise this scenario. > > Thanks, this is ok. Thanks, pushed. 94c18618a8e29894a7b3104375e0510d71a568fb -- Sergio GPG key ID: 237A 54B1 0287 28BF 00EF 31F4 D0EB 7628 65FC 5E36 Please send encrypted e-mail if possible http://sergiodj.net/