From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 16428 invoked by alias); 19 Jan 2004 19:15:28 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 16365 invoked from network); 19 Jan 2004 19:15:26 -0000 Received: from unknown (HELO nevyn.them.org) (66.93.172.17) by sources.redhat.com with SMTP; 19 Jan 2004 19:15:26 -0000 Received: from drow by nevyn.them.org with local (Exim 4.30 #1 (Debian)) id 1AieWT-0002Ju-8Q for ; Mon, 19 Jan 2004 13:53:17 -0500 Date: Mon, 19 Jan 2004 19:15:00 -0000 From: Daniel Jacobowitz To: gdb-patches@sources.redhat.com Subject: Re: [PATCH/RFC] Reorganize osabi.c:generic_elf_osabi_sniff_abi_tag_sections() Message-ID: <20040119185317.GA20236@nevyn.them.org> Mail-Followup-To: gdb-patches@sources.redhat.com References: <200401182040.i0IKeeMu008703@elgar.kettenis.dyndns.org> <20040118225254.GA8516@nevyn.them.org> <200401191839.i0JId3oh000527@elgar.kettenis.dyndns.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <200401191839.i0JId3oh000527@elgar.kettenis.dyndns.org> User-Agent: Mutt/1.5.1i X-SW-Source: 2004-01/txt/msg00517.txt.bz2 On Mon, Jan 19, 2004 at 07:39:03PM +0100, Mark Kettenis wrote: > Date: Sun, 18 Jan 2004 17:52:54 -0500 > From: Daniel Jacobowitz > > On Sun, Jan 18, 2004 at 09:40:40PM +0100, Mark Kettenis wrote: > > + /* ...and check it. */ > > + gdb_assert (notesz <= MAX_NOTESZ); > > + if (notesz > bfd_section_size (abfd, sect)) > > + return 0; > > I'd rather not add assertions based on the input file. Can we complain > and fail instead? > > Ah, but the assert is an internal consistency check. It checks > whether the MAX_NOTESZ limit is large enough for the note the caller > of check_note() is checking for. Basically the assert triggers if > someone adds a check_note() call with a long name, or a large > descriptor size. In that case the person in question should increase > MAX_NOTESZ. The assert is guaranteed not to be triggered for the > check_note() calls in my patch. Oh, you're right - I leapt to the conclusion that this was based on the size of notes in the input. Sorry. -- Daniel Jacobowitz MontaVista Software Debian GNU/Linux Developer