Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: msnyder@sonic.net
To: gdb-patches@sourceware.org
Subject: [patch] linux-thread-db, check return value of find_thread_pid
Date: Thu, 28 Jun 2007 22:42:00 -0000	[thread overview]
Message-ID: <15898.12.7.175.2.1183070127.squirrel@webmail.sonic.net> (raw)

May return null, check before using.

2007-06-28  Michael Snyder  <msnyder@access-company.com>

        * linux-thread-db.c (thread_db_get_thread_local_address): Add
        gdb_assert before using return value of find_thread_pid (Coverity).

Index: linux-thread-db.c
===================================================================
RCS file: /cvs/src/src/gdb/linux-thread-db.c,v
retrieving revision 1.32
diff -p -r1.32 linux-thread-db.c
*** linux-thread-db.c   27 Jun 2007 11:52:02 -0000      1.32
--- linux-thread-db.c   28 Jun 2007 22:31:48 -0000
*************** thread_db_get_thread_local_address (ptid
*** 1081,1086 ****
--- 1081,1087 ----

        /* Get info about the thread.  */
        thread_info = find_thread_pid (ptid);
+       gdb_assert (thread_info);
        thread_db_map_id2thr (thread_info, 1);

        /* Finally, get the address of the variable.  */



             reply	other threads:[~2007-06-28 22:35 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-06-28 22:42 msnyder [this message]
2007-06-28 23:04 ` Daniel Jacobowitz

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=15898.12.7.175.2.1183070127.squirrel@webmail.sonic.net \
    --to=msnyder@sonic.net \
    --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