This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] nto target: fix null pointer dereference
- From: "Ulrich Weigand" <uweigand at de dot ibm dot com>
- To: aristovski at qnx dot com
- Cc: gdb-patches at sources dot redhat dot com
- Date: Tue, 12 Aug 2008 20:32:38 +0200 (CEST)
- Subject: Re: [patch] nto target: fix null pointer dereference
Aleksandar Ristovski wrote:
>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);
> }
I'm wondering how this can ever be NULL ... I understand nto
reuses the solib-svr4.c version of current_sos, which seems
to always initalize the lm member.
Can you explain what the situation is that leads to a NULL
pointer here?
Bye,
Ulrich
--
Dr. Ulrich Weigand
GNU Toolchain for Linux on System z and Cell BE
Ulrich.Weigand@de.ibm.com