aboutsummaryrefslogtreecommitdiff
path: root/src/libutil/tarfile.cc
diff options
context:
space:
mode:
authorYorick van Pelt <yorick@yorickvanpelt.nl>2021-12-10 17:00:32 +0100
committerYorick van Pelt <yorick@yorickvanpelt.nl>2021-12-10 17:00:32 +0100
commitbe1055f2cc8841954521bf30a6f886cf3c807a28 (patch)
tree22bed1a70eaa92dd61bd87960ce37f39544fb454 /src/libutil/tarfile.cc
parent20b1290103f23e40614518291b8d4847e37fea05 (diff)
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.
Diffstat (limited to 'src/libutil/tarfile.cc')
-rw-r--r--src/libutil/tarfile.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libutil/tarfile.cc b/src/libutil/tarfile.cc
index 50e691a3d..934b70162 100644
--- a/src/libutil/tarfile.cc
+++ b/src/libutil/tarfile.cc
@@ -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));