From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 103172 invoked by alias); 14 Nov 2018 23:17:32 -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 103162 invoked by uid 89); 14 Nov 2018 23:17:31 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-2.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_NONE,SPF_PASS autolearn=ham version=3.3.2 spammy=Notice, ASAP, stages, you! 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; Wed, 14 Nov 2018 23:17:29 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by filtered-rock.gnat.com (Postfix) with ESMTP id A1F9A56212; Wed, 14 Nov 2018 18:17:27 -0500 (EST) 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 Jt1Uramx5N6S; Wed, 14 Nov 2018 18:17:27 -0500 (EST) Received: from joel.gnat.com (localhost.localdomain [127.0.0.1]) by rock.gnat.com (Postfix) with ESMTP id 64E9C560D6; Wed, 14 Nov 2018 18:17:27 -0500 (EST) Received: by joel.gnat.com (Postfix, from userid 1000) id CDBB0849EA; Wed, 14 Nov 2018 15:17:24 -0800 (PST) Date: Wed, 14 Nov 2018 23:17:00 -0000 From: Joel Brobecker To: Pedro Alves Cc: Tom Tromey , gdb-patches@sourceware.org Subject: Re: [PATCH] Fix buffer overflow in ada-lang.c:move_bits Message-ID: <20181114231724.GA4336@adacore.com> References: <20181024162037.21024-1-tom@tromey.com> <20181101153517.GA2705@adacore.com> <082f66ea-223b-52f4-bc24-b274dbcf4f01@redhat.com> <609409e6-235a-4724-3ced-57c3ff42e299@redhat.com> <20181109171641.GD18647@adacore.com> <20181114171116.GA6074@adacore.com> <7628ab26-ad93-726c-f1d4-d5c60492115c@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7628ab26-ad93-726c-f1d4-d5c60492115c@redhat.com> User-Agent: Mutt/1.9.4 (2018-02-28) X-SW-Source: 2018-11/txt/msg00233.txt.bz2 > > gdb/ChangeLog: > > > > * ada-lang.c (move_bits): Delete. Update all callers to use > > copy_bitwise instead. > > * dwarf2loc.c (copy_bitwise, bits_to_str::bits_to_str) > > (selftests::check_copy_bitwise, selftests::copy_bitwise_tests): > > Move from here to utils.c. > > (_initialize_dwarf2loc): Remove call to register copy_bitwise > > selftests. > > * utils.h (copy_bitwise): Add declaration. > > * utils.c (copy_bitwise, bits_to_str::bits_to_str) > > (selftests::check_copy_bitwise, selftests::copy_bitwise_tests): > > Moved here from dwarf2loc.c. > > (_initialize_utils): Register copy_bitwise selftests. > > > > Thank you! > > -- Joel > > > > > > Great, thanks! > > Nit, since the function is now public, I'd consider moving the unit > tests to under gdb/unittests/ instead, like, to a new > copy_bitwise-selftests.c file. (I'm mildly thinking that'd be a better > filename than utils-selftest.c because the function may well > move again in the future. Notice how gdb_realpath's unit tests > were left behind in gdb/utils.c even though gdb_realpath moved to > common/pathstuff.c.) > > If you do that, you can drop the > '#if GDB_SELF_TEST' around the tests, since files in that > directory are not compiled if unit tests are disabled. I can do that. Since you said you're file reguardless, it's a little easier for me to do it in two stages, so I'll go ahead and push this one. I'll start on moving the unit tests again right after, and will finish ASAP if it's not finished by end of today. Thanks Pedro! -- Joel