]> git.ipfire.org Git - thirdparty/libarchive.git/commit
cpio: Fix UAF in error path 3055/head
authorSanjay Rawat <sanjayr@ymail.com>
Wed, 20 May 2026 16:09:40 +0000 (18:09 +0200)
committerTobias Stoeckmann <tobias@stoeckmann.org>
Wed, 20 May 2026 16:13:50 +0000 (18:13 +0200)
commitd53db9de36893b6b0f1ea293712dcf7481febfbd
treeaf9a9ccc135eb43262d5f09441db591770796d62
parentfd182c5ba56cff54d6963c3928ca4d9f363b9ff9
cpio: Fix UAF in error path

Add entry only after its full initialization into list. Otherwise the
error handling of a failing strdup would have to unlink the entry again.

Fixes: 16ad9310733e ("cpio reader: Validate pathname in record_hardlink")
Resolves #3053.
libarchive/archive_read_support_format_cpio.c