From: Tim Kientzle Date: Sat, 5 Jun 2010 01:51:47 +0000 (-0400) Subject: If the temporary file gets truncated for any reason, die X-Git-Tag: v3.0.0a~977 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=5de7cbb23280c2cc85eeddb7fc0a4de5dda7d4eb;p=thirdparty%2Flibarchive.git If the temporary file gets truncated for any reason, die instead of getting stuck in an infinite loop. SVN-Revision: 2444 --- diff --git a/libarchive/archive_write_set_format_xar.c b/libarchive/archive_write_set_format_xar.c index ebcd0932d..28292d274 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) {