]> 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>
Tue, 4 Feb 2025 20:28:42 +0000 (15:28 -0500)
commitcc1a6c088f2f5cdd2eb1dbf7856e50f6d6f7869f
tree653f7cba2e2eec85a093ff4c293b20c8b44189ce
parentc89cb740f8f146f72749345fad9c325456447418
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