extract_archive: use copy_pathname instead of set_pathname.

Libarchive documentation mentions that archive_entry_set_pathname
expects us to keep the passed string alive, which we don't.
This commit is contained in:
Yorick 2021-12-10 17:00:32 +01:00
parent 20b1290103
commit be1055f2cc
No known key found for this signature in database
GPG key ID: D8D3CC6D951384DE

View file

@ -93,7 +93,7 @@ static void extract_archive(TarArchive & archive, const Path & destDir)
else
archive.check(r);
archive_entry_set_pathname(entry,
archive_entry_copy_pathname(entry,
(destDir + "/" + name).c_str());
archive.check(archive_read_extract(archive.archive, entry, flags));