Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Tom Tromey <tromey@redhat.com>
To: Aleksandar Ristovski <aristovski@qnx.com>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [patch] buffer overflow in symtab_from_filename
Date: Thu, 25 Aug 2011 18:12:00 -0000	[thread overview]
Message-ID: <m3ei092wem.fsf@fleche.redhat.com> (raw)
In-Reply-To: <j361p2$bt$1@dough.gmane.org> (Aleksandar Ristovski's message of	"Thu, 25 Aug 2011 13:46:09 -0400")

Aleksandar> In my case, I would get it by command "b main": on entry to
Aleksandar> symtab_from_filename (called from decode_line_1, ln 879),
Aleksandar> argptr points to a pointer to argument passed to 'break'
Aleksandar> command; p (argument value on entry) points to the end of
Aleksandar> the string ('\0'). Then this value is assigned to p1.

I would have thought that lookup_symtab would return NULL here, causing
the throw_error branch to be taken.

I guess it could happen with 'break main.c'.

Aleksandar> I think it is obvious enough to not warrant a separate test case?

I agree.

Patch is ok, please commit.

Tom


  reply	other threads:[~2011-08-25 18:12 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-25 16:06 Aleksandar Ristovski
2011-08-25 17:34 ` Tom Tromey
2011-08-25 17:46   ` Aleksandar Ristovski
2011-08-25 18:12     ` Tom Tromey [this message]
2011-08-26 18:04       ` Aleksandar Ristovski

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=m3ei092wem.fsf@fleche.redhat.com \
    --to=tromey@redhat.com \
    --cc=aristovski@qnx.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