]> git.ipfire.org Git - thirdparty/elfutils.git/commit
readelf: check elf_getarhdr returns NULL in dump_archive_index
authorAnton Moryakov <ant.v.moryakov@gmail.com>
Thu, 13 Feb 2025 15:57:42 +0000 (18:57 +0300)
committerMark Wielaard <mark@klomp.org>
Thu, 27 Feb 2025 17:24:23 +0000 (18:24 +0100)
commitd40e0808309babcf2c88864aa3acef23f1fd3a70
treebdfd15a1904293ad2bd7a5d9bb3a481580a6f721
parent52a747a316042e70a22acb489df9e51bfc6bf2d5
readelf: check elf_getarhdr returns NULL in dump_archive_index

Report of the static analyzer:
DEREF_OF_NULL.RET Pointer, returned from function 'elf_getarhdr' at
readelf.c:13551, may be NULL and is dereferenced at readelf.c:13553.

    * src/readelf.c (dump_archive_index): Check elf_getarhdr doesn't
    return NULL.

Triggers found by static analyzer Svace.

Signed-off-by: Anton Moryakov <ant.v.moryakov@gmail.com>
src/readelf.c