2007-06-28 Michael Snyder <msnyder@access-company.com>
authorMichael Snyder <msnyder@vmware.com>
Thu, 28 Jun 2007 23:02:06 +0000 (23:02 +0000)
committerMichael Snyder <msnyder@vmware.com>
Thu, 28 Jun 2007 23:02:06 +0000 (23:02 +0000)
* linux-thread-db.c (thread_db_get_thread_local_address): Add
gdb_assert before using return value of find_thread_pid (Coverity).

gdb/ChangeLog
gdb/linux-thread-db.c

index 8ce75e68f5abe5bc9fb442e34d3dcc3774a1aabb..43ee13ebcd3bac190a034d1665fac555bd9ef088 100644 (file)
@@ -1,5 +1,8 @@
 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).
+
        * source.c (unset_substitute_path_command): Plug leak (Coverity).
 
        * cli/cli-script.c (build_command_line): Add null pointer guard 
index 460e044c26ee379685c132378646064c843a21df..91e12e89d0ff195aa2f841d2305735eba727cf1f 100644 (file)
@@ -1081,6 +1081,7 @@ thread_db_get_thread_local_address (ptid_t ptid,
 
       /* 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.  */