Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Mark Kettenis <kettenis@chello.nl>
To: drow@mvista.com
Cc: gdb-patches@sources.redhat.com
Subject: Re: [PATCH/RFC] Reorganize osabi.c:generic_elf_osabi_sniff_abi_tag_sections()
Date: Mon, 19 Jan 2004 18:39:00 -0000	[thread overview]
Message-ID: <200401191839.i0JId3oh000527@elgar.kettenis.dyndns.org> (raw)
In-Reply-To: <20040118225254.GA8516@nevyn.them.org> (message from Daniel Jacobowitz on Sun, 18 Jan 2004 17:52:54 -0500)

   Date: Sun, 18 Jan 2004 17:52:54 -0500
   From: Daniel Jacobowitz <drow@mvista.com>

   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.

The following if-statement does a sanity check on the input file.  We
simply return 0 is the section is too small.

I'll add some comments spelling this out before I check this in.

Mark


  reply	other threads:[~2004-01-19 18:39 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-01-18 20:40 Mark Kettenis
2004-01-18 22:52 ` Daniel Jacobowitz
2004-01-19 18:39   ` Mark Kettenis [this message]
2004-01-19 19:15     ` Daniel Jacobowitz
2004-01-21 23:08       ` Mark Kettenis
2004-01-22  7:35         ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=200401191839.i0JId3oh000527@elgar.kettenis.dyndns.org \
    --to=kettenis@chello.nl \
    --cc=drow@mvista.com \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox