]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libelf: check ehdr isn't NULL before calling default_ehdr
authorMark Wielaard <mark@klomp.org>
Mon, 15 Sep 2025 21:58:08 +0000 (23:58 +0200)
committerMark Wielaard <mark@klomp.org>
Mon, 15 Sep 2025 22:03:19 +0000 (00:03 +0200)
commit13153e98ee4f4b4ad2c73c2a747b6c2db984e029
tree9f778b0560575d53777f8a698d41c2675b75e0f3
parente833b1778754fc598ef867a3c3623187fb165510
libelf: check ehdr isn't NULL before calling default_ehdr

default_ehdr assumes the passed ehdr pointer is not NULL and can be
directly dereferenced. But getehdr can return NULL. So explicitly
check.

* libelf/elf32_updatenull.c (updatenull_wrlock): Check ehdr is
        not NULL.

https://sourceware.org/bugzilla/show_bug.cgi?id=33433

Signed-off-by: Mark Wielaard <mark@klomp.org>
libelf/elf32_updatenull.c