Catch decompression failures earlier. In particular, this gives
immediate feedback if we fail to fork an external decompression program.
This commit is contained in:
parent
e2196d3e85
commit
dee0ce0cbd
@ -354,6 +354,7 @@ build_stream(struct archive_read *a)
|
||||
int number_bidders, i, bid, best_bid;
|
||||
struct archive_read_filter_bidder *bidder, *best_bidder;
|
||||
struct archive_read_filter *filter;
|
||||
ssize_t avail;
|
||||
int r;
|
||||
|
||||
for (;;) {
|
||||
@ -392,6 +393,13 @@ build_stream(struct archive_read *a)
|
||||
free(filter);
|
||||
return (r);
|
||||
}
|
||||
/* Verify the filter by asking it for some data. */
|
||||
__archive_read_filter_ahead(filter, 1, &avail);
|
||||
if (avail < 0) {
|
||||
/* If the read failed, bail out now. */
|
||||
free(filter);
|
||||
return (avail);
|
||||
}
|
||||
a->filter = filter;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user