summaryrefslogtreecommitdiff
path: root/libarchive/archive_read_support_format_tar.c
diff options
context:
space:
mode:
authorSamanta Navarro <ferivoz@riseup.net>2021-06-01 11:26:30 +0000
committerSamanta Navarro <ferivoz@riseup.net>2021-06-01 11:26:45 +0000
commit87afe3146302a32f195b184eb9dad689037be6c5 (patch)
tree7cc26ccc2ae9595cedf8117dc66ad8005d7f89cb /libarchive/archive_read_support_format_tar.c
parent5bb998d869979140156bce59c0ff8f9063a25581 (diff)
downloadlibarchive-87afe3146302a32f195b184eb9dad689037be6c5.tar.gz
Fix mutual check in tar sparse handling
GNU.sparse.numbytes and GNU.sparse.offset both have to be set before gnu_add_sparse_entry can be called. The GNU.sparse.numbytes parser checks for tar->sparse_numbytes. This has to be tar->sparse_offset instead to work just like the GNU.sparse.offset parser.
Diffstat (limited to 'libarchive/archive_read_support_format_tar.c')
-rw-r--r--libarchive/archive_read_support_format_tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libarchive/archive_read_support_format_tar.c b/libarchive/archive_read_support_format_tar.c
index 96d81018..9a32562d 100644
--- a/libarchive/archive_read_support_format_tar.c
+++ b/libarchive/archive_read_support_format_tar.c
@@ -1906,7 +1906,7 @@ pax_attribute(struct archive_read *a, struct tar *tar,
}
if (strcmp(key, "GNU.sparse.numbytes") == 0) {
tar->sparse_numbytes = tar_atol10(value, strlen(value));
- if (tar->sparse_numbytes != -1) {
+ if (tar->sparse_offset != -1) {
if (gnu_add_sparse_entry(a, tar,
tar->sparse_offset, tar->sparse_numbytes)
!= ARCHIVE_OK)