cab: Cover all error cases in __archive_read_ahead (#2194)

If a short read is performed, fail with truncation error message as
well.
This commit is contained in:
Tobias Stoeckmann authored and GitHub committed 2024-05-17 21:37:14 -07:00
1 parent adf7388139
commit 17333c27ad
1 file changed
+1 -1
+1 -1
View File
@@ -1682,7 +1682,7 @@ cab_read_ahead_cfdata_lzx(struct archive_read *a, ssize_t *avail)
cfdata->uncompressed_size - cab->xstrm.total_out;
d = __archive_read_ahead(a, 1, &bytes_avail);
if (bytes_avail <= 0) {
if (d == NULL) {
archive_set_error(&a->archive,
ARCHIVE_ERRNO_FILE_FORMAT,
"Truncated CAB file data");