Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@adacore.com>
To: Michael Snyder <msnyder@vmware.com>
Cc: "gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: Re: [commit] record.c (record_restore): Check pointer before use.
Date: Wed, 02 Mar 2011 04:27:00 -0000	[thread overview]
Message-ID: <20110302042646.GL30306@adacore.com> (raw)
In-Reply-To: <4D6D564A.8080403@vmware.com>

> 2011-03-01  Michael Snyder  <msnyder@vmware.com>
> 
> 	* reverse.c (record_restore): Move null-check to before pointer
> 	dereference.
> 
> Index: record.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/record.c,v
> retrieving revision 1.57
> diff -u -p -u -p -r1.57 record.c
> --- record.c	10 Jan 2011 20:38:50 -0000	1.57
> +++ record.c	1 Mar 2011 20:23:33 -0000
> @@ -2214,12 +2214,12 @@ record_restore (void)
>  
>    /* Now need to find our special note section.  */
>    osec = bfd_get_section_by_name (core_bfd, "null0");
> +  if (osec == NULL)
> +    return;
>    osec_size = bfd_section_size (core_bfd, osec);
>    if (record_debug)
>      fprintf_unfiltered (gdb_stdlog, "Find precord section %s.\n",
>  			osec ? "succeeded" : "failed");
> -  if (osec == NULL)
> -    return;

I think that the debug trace ("Find precord section...") also
needs to be moved up.

-- 
Joel


  reply	other threads:[~2011-03-02  4:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-01 20:25 Michael Snyder
2011-03-02  4:27 ` Joel Brobecker [this message]
2011-03-02 18:09   ` Michael Snyder
2011-03-02 19:33     ` Joel Brobecker

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=20110302042646.GL30306@adacore.com \
    --to=brobecker@adacore.com \
    --cc=gdb-patches@sourceware.org \
    --cc=msnyder@vmware.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