]> git.ipfire.org Git - thirdparty/elfutils.git/commit
libdwfl/offline.c: Avoid closing invalid fd
authorAaron Merey <amerey@redhat.com>
Fri, 31 Jan 2025 01:16:11 +0000 (20:16 -0500)
committerAaron Merey <amerey@redhat.com>
Fri, 7 Feb 2025 22:13:51 +0000 (17:13 -0500)
commit78bdee7cb881b6b6df23872d898458fa4b486ac0
tree7070e546fa000e04fdff995195e8599bf249f0c3
parent6c76ce7331e82a6fc6c2004e8e6ae51ca91f51d7
libdwfl/offline.c: Avoid closing invalid fd

process_archive may be called with an fd argument of -1, which
libelf interprets as "no file opened".  However when closing
the fd process_archive does not check whether the fd is valid
and may attempt to close an fd of -1.

Signed-off-by: Aaron Merey <amerey@redhat.com>
libdwfl/offline.c