This is the mail archive of the elfutils-devel@sourceware.org mailing list for the elfutils 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] libdw: Resolve alt file on first use.


On Thu, 2018-01-25 at 16:28 +0100, Mark Wielaard wrote:
> Testing under valgrind showed that this should be build_id_len <= 0.
> When dwelf_dwarf_gnu_debugaltlink returns 0 it means there was no
> .gnu_debugaltlink section at all. A negative return value means the
> data found was corrupt. In both cases neither altname nor build_id
> might be set up. So I added the following fixup:
> 
> diff --git a/libdw/dwarf_getalt.c b/libdw/dwarf_getalt.c
> index 7b41a2b..3e5af15 100644
> --- a/libdw/dwarf_getalt.c
> +++ b/libdw/dwarf_getalt.c
> @@ -117,7 +117,7 @@ find_debug_altlink (Dwarf *dbg)
>                                                                &build
> _id);
>  
>    /* Couldn't even get the debugaltlink.  It probably doesn't
> exist.  */
> -  if (build_id_len < 0)
> +  if (build_id_len <= 0)
>      return;
>  
>    const uint8_t *id = (const uint8_t *) build_id;

I pushed this patch to master with this small fixup.

Cheers,

Mark


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