This is the mail archive of the
mailing list for the elfutils project.
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)
> /* Couldn't even get the debugaltlink. It probably doesn't
> exist. */
> - if (build_id_len < 0)
> + if (build_id_len <= 0)
> const uint8_t *id = (const uint8_t *) build_id;
I pushed this patch to master with this small fixup.