From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12252 invoked by alias); 28 Jun 2007 22:35:34 -0000 Received: (qmail 12244 invoked by uid 22791); 28 Jun 2007 22:35:34 -0000 X-Spam-Check-By: sourceware.org Received: from b.mail.sonic.net (HELO b.mail.sonic.net) (64.142.19.5) by sourceware.org (qpsmtpd/0.31) with ESMTP; Thu, 28 Jun 2007 22:35:29 +0000 Received: from webmail.sonic.net (b.webmail.sonic.net [64.142.100.148]) by b.mail.sonic.net (8.13.8.Beta0-Sonic/8.13.7) with ESMTP id l5SMZR6k003950 for ; Thu, 28 Jun 2007 15:35:27 -0700 Received: from 12.7.175.2 (SquirrelMail authenticated user msnyder) by webmail.sonic.net with HTTP; Thu, 28 Jun 2007 15:35:27 -0700 (PDT) Message-ID: <15898.12.7.175.2.1183070127.squirrel@webmail.sonic.net> Date: Thu, 28 Jun 2007 22:42:00 -0000 Subject: [patch] linux-thread-db, check return value of find_thread_pid From: msnyder@sonic.net To: gdb-patches@sourceware.org User-Agent: SquirrelMail/1.4.9a MIME-Version: 1.0 Content-Type: text/plain;charset=iso-8859-1 Content-Transfer-Encoding: 8bit Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org X-SW-Source: 2007-06/txt/msg00503.txt.bz2 May return null, check before using. 2007-06-28 Michael Snyder * 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. */