From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 84403 invoked by alias); 14 Mar 2019 11:37:30 -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 84394 invoked by uid 89); 14 Mar 2019 11:37:30 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-14.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.1 spammy= X-HELO: rock.gnat.com Received: from rock.gnat.com (HELO rock.gnat.com) (205.232.38.15) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 14 Mar 2019 11:37:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id C2A7556086; Thu, 14 Mar 2019 07:37:27 -0400 (EDT) Received: from rock.gnat.com ([127.0.0.1]) by localhost (rock.gnat.com [127.0.0.1]) (amavisd-new, port 10024) with LMTP id 9DxCesZ-S6nD; Thu, 14 Mar 2019 07:37:27 -0400 (EDT) Received: from murgatroyd (174-29-37-56.hlrn.qwest.net [174.29.37.56]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by rock.gnat.com (Postfix) with ESMTPSA id 5B8995607C; Thu, 14 Mar 2019 07:37:27 -0400 (EDT) From: Tom Tromey To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [RFC 8.3 3/3] Avoid a crash in source_cache::extract_lines References: <20190308210433.32683-1-tromey@adacore.com> <20190308210433.32683-4-tromey@adacore.com> <87va0mpu7o.fsf@tromey.com> Date: Thu, 14 Mar 2019 11:37:00 -0000 In-Reply-To: (Pedro Alves's message of "Wed, 13 Mar 2019 18:06:13 +0000") Message-ID: <877ed1hekp.fsf@tromey.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-SW-Source: 2019-03/txt/msg00287.txt.bz2 >>>>> "Pedro" == Pedro Alves writes: Pedro> IIUC, the function can never really return false, right? Since Pedro> get_source_lines already validates input. If you made extract_lines Pedro> return std::string instead of using an output parameter, I went ahead and made this change. Tom