If __archive_read_filter_consume fails, report information about
detected truncation.
In many cases, the return value can be ignored since
__archive_read_ahead already performed the check. In this case, we never
read the data before, so add the check here.
Signed-off-by: Tobias Stoeckmann <tobias@stoeckmann.org>
return (ARCHIVE_FATAL);
}
int64_t skip_bytes = archive_le32dec(read_buf);
- __archive_read_filter_consume(self->upstream,
- 4 + skip_bytes);
+ if (__archive_read_filter_consume(self->upstream,
+ 4 + skip_bytes) < 0) {
+ archive_set_error(
+ &self->archive->archive,
+ ARCHIVE_ERRNO_MISC,
+ "Malformed lz4 data");
+ return (ARCHIVE_FATAL);
+ }
} else {
/* Ignore following unrecognized data. */
state->eof = 1;