This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
[patch] nto target: fix null pointer dereference
- From: Aleksandar Ristovski <aristovski at qnx dot com>
- To: gdb-patches at sources dot redhat dot com
- Cc: Ulrich Weigand <uweigand at de dot ibm dot com>
- Date: Tue, 12 Aug 2008 12:37:28 -0400
- Subject: [patch] nto target: fix null pointer dereference
Hello,
Simple patch to fix null pointer dereference. This should make qnx target operational and usable.
Thanks,
Aleksandar Ristovski
QNX Software Systems
2008-08-12 Aleksandar Ristovski <aristovski@qnx.com>
* nto-tdep.c (LM_ADDR): Make sure the address is valid before
dereferencing.
Index: gdb/nto-tdep.c
===================================================================
RCS file: /cvs/src/src/gdb/nto-tdep.c,v
retrieving revision 1.25
diff -u -p -r1.25 nto-tdep.c
--- gdb/nto-tdep.c 23 Jul 2008 13:36:00 -0000 1.25
+++ gdb/nto-tdep.c 12 Aug 2008 16:33:18 -0000
@@ -266,6 +266,8 @@ LM_ADDR (struct so_list *so)
{
struct link_map_offsets *lmo = nto_fetch_link_map_offsets ();
+ if (so->lm_info->lm == NULL)
+ return 0;
return extract_typed_address (so->lm_info->lm + lmo->l_addr_offset,
builtin_type_void_data_ptr);
}