aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
diff options
context:
space:
mode:
authorMartin Matuska <mm@FreeBSD.org>2017-05-18 19:50:15 +0000
committerMartin Matuska <mm@FreeBSD.org>2017-05-18 19:50:15 +0000
commite90edd929ccc12856798c6391aa7e1b69689874e (patch)
tree80f9d690c6102c2bed95e207cceb45272ee455b6 /contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
parent5137794316197871a128364eb537da7d55885fdd (diff)
downloadsrc-e90edd929ccc12856798c6391aa7e1b69689874e.tar.gz
src-e90edd929ccc12856798c6391aa7e1b69689874e.zip
MFC r317782,318181:
MFC r317782 (mm): Sync libarchive with vendor Vendor changes (FreeBSD-related): PR 897: add test for ZIP archives with invalid EOCD headers PR 901: fix invalid renaming of sparse files OSS-Fuzz issue 497: remove fallback tree in LZX decoder OSS-Fuzz issue 527: rewrite expressions in lz4 filter OSS-Fuzz issue 577: fix integer overflow in cpio reader OSS-Fuzz issue 862: fix numerc parsing in mtree reader OSS-Fuzz issue 1097: fix undefined shift in rar reader cpio: various optimizations and memory leak fixes MFC r318181 (ngie) (2): cpio/tests/test_option_lz4: fix a use after free in the failure case Reported by: Coverity (2) Sponsored by: Dell EMC Isilon (2)
Notes
Notes: svn path=/stable/10/; revision=318483
Diffstat (limited to 'contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c')
-rw-r--r--contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c b/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
index 9d845fa0ef93..89c8fd066afa 100644
--- a/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
+++ b/contrib/libarchive/libarchive/archive_read_disk_entry_from_file.c
@@ -916,11 +916,10 @@ setup_sparse(struct archive_read_disk *a,
return (ARCHIVE_OK);
/* Does filesystem support the reporting of hole ? */
- if (*fd < 0) {
+ if (*fd < 0)
path = archive_read_disk_entry_setup_path(a, entry, fd);
- if (path == NULL)
- return (ARCHIVE_FAILED);
- }
+ else
+ path = NULL;
if (*fd >= 0) {
#ifdef _PC_MIN_HOLE_SIZE
@@ -931,6 +930,8 @@ setup_sparse(struct archive_read_disk *a,
if (initial_off != 0)
lseek(*fd, 0, SEEK_SET);
} else {
+ if (path == NULL)
+ return (ARCHIVE_FAILED);
#ifdef _PC_MIN_HOLE_SIZE
if (pathconf(path, _PC_MIN_HOLE_SIZE) <= 0)
return (ARCHIVE_OK);