This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [patch] Fix crash in svr4_clear_so


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/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]