aboutsummaryrefslogtreecommitdiffstats
path: root/libarchive/archive_read_disk_entry_from_file.c
diff options
context:
space:
mode:
Diffstat (limited to 'libarchive/archive_read_disk_entry_from_file.c')
-rw-r--r--libarchive/archive_read_disk_entry_from_file.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
index 700f9e3ae1af..548ba89ef3db 100644
--- a/libarchive/archive_read_disk_entry_from_file.c
+++ b/libarchive/archive_read_disk_entry_from_file.c
@@ -928,11 +928,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
@@ -943,6 +942,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);