1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-08 19:46:02 +01:00

Merge pull request #13173 from NixOS/better-truncated-tar-error

Improve 'cannot read file from tarball' error
This commit is contained in:
Jörg Thalheim 2025-05-13 12:34:27 +02:00 committed by GitHub
commit 1ac4bf122b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -215,7 +215,7 @@ time_t unpackTarfileToSink(TarArchive & archive, ExtendedFileSystemObjectSink &
std::vector<unsigned char> buf(128 * 1024);
auto n = archive_read_data(archive.archive, buf.data(), buf.size());
if (n < 0)
throw Error("cannot read file '%s' from tarball", path);
checkLibArchive(archive.archive, n, "cannot read file from tarball: %s");
if (n == 0)
break;
crf(std::string_view{