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.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libarchive/archive_read_disk_entry_from_file.c b/libarchive/archive_read_disk_entry_from_file.c
index 1786cff38453..7b6102e5eecf 100644
--- a/libarchive/archive_read_disk_entry_from_file.c
+++ b/libarchive/archive_read_disk_entry_from_file.c
@@ -163,6 +163,9 @@ archive_read_disk_entry_from_file(struct archive *_a,
int initial_fd = fd;
int r, r1;
+ archive_check_magic(_a, ARCHIVE_READ_DISK_MAGIC, ARCHIVE_STATE_ANY,
+ "archive_read_disk_entry_from_file");
+
archive_clear_error(_a);
path = archive_entry_sourcepath(entry);
if (path == NULL)