diff options
author | Samanta Navarro <ferivoz@riseup.net> | 2021-06-01 11:26:30 +0000 |
---|---|---|
committer | Samanta Navarro <ferivoz@riseup.net> | 2021-06-01 11:26:45 +0000 |
commit | 87afe3146302a32f195b184eb9dad689037be6c5 (patch) | |
tree | 7cc26ccc2ae9595cedf8117dc66ad8005d7f89cb /libarchive/archive_read_support_format_tar.c | |
parent | 5bb998d869979140156bce59c0ff8f9063a25581 (diff) | |
download | libarchive-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.c | 2 |
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) |