Don't hang in decompression if bzip2 data ends prematurely

This commit is contained in:
Eelco Dolstra
2017-03-21 19:23:35 +01:00
parent aa23bba27f
commit ed5c0f69f2
+6
View File
@@ -49,6 +49,9 @@ static ref<std::string> decompressXZ(const std::string & in)
if (ret != LZMA_OK)
throw Error("error while decompressing xz file");
if (strm.avail_in == 0)
throw Error("xz data ends prematurely");
}
}
@@ -86,6 +89,9 @@ static ref<std::string> decompressBzip2(const std::string & in)
if (ret != BZ_OK)
throw Error("error while decompressing bzip2 file");
if (strm.avail_in == 0)
throw Error("bzip2 data ends prematurely");
}
}