This is the mail archive of the
gdb-patches@sourceware.org
mailing list for the GDB project.
Re: [patch] Fix crash in svr4_clear_so
- From: Gary Benson <gbenson at redhat dot com>
- To: Paul Pluzhnikov <ppluzhnikov at google dot com>
- Cc: gdb-patches at sourceware dot org
- Date: Wed, 22 May 2013 11:32:47 +0100
- Subject: Re: [patch] Fix crash in svr4_clear_so
- References: <ye6qa9no55vu dot fsf at elbrus2 dot mtv dot corp dot google dot com>
Paul Pluzhnikov wrote:
> Using current trunk, I've got a GDB core dump when I tried to analyze
> mis-matched binary and core:
...
> Index: solib-svr4.c
> ===================================================================
> RCS file: /cvs/src/src/gdb/solib-svr4.c,v
> retrieving revision 1.177
> diff -p -u -r1.177 solib-svr4.c
> --- solib-svr4.c 6 May 2013 22:18:38 -0000 1.177
> +++ solib-svr4.c 21 May 2013 22:19:09 -0000
> @@ -971,7 +971,8 @@ svr4_free_so (struct so_list *so)
> static void
> svr4_clear_so (struct so_list *so)
> {
> - so->lm_info->l_addr_p = 0;
> + if (so->lm_info != NULL)
> + so->lm_info->l_addr_p = 0;
> }
>
> /* Free so_list built so far (called via cleanup). */
Looks good to me.
Thanks,
Gary
--
http://gbenson.net/