[patch] Fix crash in svr4_clear_so

Gary Benson gbenson@redhat.com
Wed May 22 10:32:00 GMT 2013


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/



More information about the Gdb-patches mailing list