public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Tom Tromey <tom@tromey.com>
To: Gary Benson <gbenson@redhat.com>
Cc: gdb-patches@sourceware.org
Subject: Re: [PATCH] Fix buffer overrun found by Coverity
Date: Fri, 05 Oct 2018 14:18:00 -0000	[thread overview]
Message-ID: <87o9c8h3y9.fsf@tromey.com> (raw)
In-Reply-To: <1538747591-32283-1-git-send-email-gbenson@redhat.com> (Gary	Benson's message of "Fri, 5 Oct 2018 14:53:11 +0100")

>>>>> "Gary" == Gary Benson <gbenson@redhat.com> writes:

Gary> I would have committed this as obvious, but the testsuite doesn't
Gary> exercise this piece of code; I can't realistically say I've regression
Gary> tested this change, so I'd like another pair of eyes on it to be sure.

What about the fission-dwp.exp board maybe?
Or one of the other boards.

Gary> -      memset (ids, 255, (DW_SECT_MAX + 1) * sizeof (int32_t));
Gary> -      memset (ids_seen, 255, (DW_SECT_MAX + 1) * sizeof (int32_t));
Gary> +      memset (ids, 255, sizeof_ids);
Gary> +      memset (ids_seen, 255, sizeof (ids_seen));

Later the code does this:

	  if (id < DW_SECT_MIN || id > DW_SECT_MAX)
	    {
	      error (_("Dwarf Error: bad DWP hash table, bad section id %d"
[...]
	  ids_seen[id] = i;
	  ids[i] = id;

So I think it would be good to ensure that MAX_NR_V2_DWO_SECTIONS is
>= DW_SECT_MAX + 1.  At least if I'm understanding this properly.

Tom

  reply	other threads:[~2018-10-05 14:18 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-05 13:53 Gary Benson
2018-10-05 14:18 ` Tom Tromey [this message]
2018-10-08 16:34   ` Gary Benson
2018-10-08 17:41     ` Tom Tromey
2018-10-09 13:25       ` Gary Benson

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=87o9c8h3y9.fsf@tromey.com \
    --to=tom@tromey.com \
    --cc=gbenson@redhat.com \
    --cc=gdb-patches@sourceware.org \
    /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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).