diff options
-rw-r--r-- | libarchive/archive_write_set_format_xar.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c index ebcd0932..28292d27 100644 --- a/libarchive/archive_write_set_format_xar.c +++ b/libarchive/archive_write_set_format_xar.c @@ -1733,6 +1733,11 @@ copy_out(struct archive_write *a, uint64_t offset, uint64_t length) (intmax_t)rs); return (ARCHIVE_FATAL); } + if (rs == 0) { + archive_set_error(&(a->archive), 0, + "Truncated xar archive"); + return (ARCHIVE_FATAL); + } xar->wbuff_remaining -= rs; length -= rs; if (xar->wbuff_remaining == 0) { |