[PATCH] libelf: Handle elf_strptr on section without any data
Aaron Merey
amerey@redhat.com
Thu Feb 13 20:36:54 GMT 2025
Hi Mark,
On Wed, Feb 12, 2025 at 6:16 PM Mark Wielaard <mark@klomp.org> wrote:
>
> In the unlikely situation that elf_strptr was called on a section with
> sh_size already set, but that doesn't have any data yet we could crash
> trying to verify the string to return.
>
> This could happen for example when a new section was created with
> elf_newscn, but no data having been added yet.
>
> * libelf/elf_strptr.c (elf_strptr): Check strscn->rawdata_base
> is not NULL.
>
> https://sourceware.org/bugzilla/show_bug.cgi?id=32672
>
> Signed-off-by: Mark Wielaard <mark@klomp.org>
LGTM.
Aaron
More information about the Elfutils-devel
mailing list