Merge pull request #3144 from stoeckmann/cab_truncation
cab: Improve truncation detection
(cherry picked from commit 26f68fcc6d)
This commit is contained in:
1 parent
fb76871b3f
commit
e90bccd387
1 file changed
+4
-8
@@ -1580,11 +1580,9 @@ cab_read_ahead_cfdata_deflate(struct archive_read *a, ssize_t *avail)
|
||||
* correctly compute the sum of CFDATA accordingly.
|
||||
*/
|
||||
if (cfdata->compressed_bytes_remaining > 0) {
|
||||
ssize_t bytes_avail;
|
||||
|
||||
d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
|
||||
&bytes_avail);
|
||||
if (bytes_avail <= 0) {
|
||||
NULL);
|
||||
if (d == NULL) {
|
||||
*avail = truncated_error(a);
|
||||
return (NULL);
|
||||
}
|
||||
@@ -1752,11 +1750,9 @@ cab_read_ahead_cfdata_lzx(struct archive_read *a, ssize_t *avail)
|
||||
* Make sure a read pointer advances to next CFDATA.
|
||||
*/
|
||||
if (cfdata->compressed_bytes_remaining > 0) {
|
||||
ssize_t bytes_avail;
|
||||
|
||||
d = __archive_read_ahead(a, cfdata->compressed_bytes_remaining,
|
||||
&bytes_avail);
|
||||
if (bytes_avail <= 0) {
|
||||
NULL);
|
||||
if (d == NULL) {
|
||||
*avail = truncated_error(a);
|
||||
return (NULL);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user