diff --git a/lib/libarchive/archive_write_open_filename.c b/lib/libarchive/archive_write_open_filename.c index 8f2ece65fd83..702a31e54ea7 100644 --- a/lib/libarchive/archive_write_open_filename.c +++ b/lib/libarchive/archive_write_open_filename.c @@ -118,6 +118,12 @@ file_open(struct archive *a, void *client_data) archive_write_set_bytes_in_last_block(a, 0); } + if (fstat(mine->fd, &st) != 0) { + archive_set_error(a, errno, "Couldn't stat '%s'", + mine->filename); + return (ARCHIVE_FATAL); + } + /* * Set up default last block handling. */