summaryrefslogtreecommitdiff
path: root/bz2_decompressor.cc
AgeCommit message (Collapse)Author
2018-03-12Fix infinite loop when providing a partial input bz2 stream.Alex Deymo
The bz2 decompressor expects to read from the input until there's enough output produced. This patch makes the read fail if we get stuck without making any progress in the decompression. Bug: chromium:818174 Test: Added unittest. Change-Id: Iaee8a2184ec1c5a7dbbe261ec77a39ce247965a3
2018-03-12Destroy the bz2 decompressor on destruction.Alex Deymo
When the patching fails, we never close the decompressor which leaks the internal decompressor structure. This patch keeps track of that and releases it when needed. Bug: chromium:820043 Test: Ran it through ASAN with the example provided in the bug before and after this patch. Change-Id: I29d3e99608333c6b8bf129a89cba26b7d029a561
2018-02-14Add missing newline at end of file.Alex Deymo
Bug: None Test: Still builds. Change-Id: I26f9a3155315c3b7fb8104dc708df312a5860731
2017-11-30Implement a simple logger for bsdiffTianjie Xu
The logger supports LOG & PLOG. It also adds a std::endl at the end of the stream so that we don't need to add it manually at the callsite. Test: run bsdiff and check the logs. Change-Id: Ice94902a501532ceaeb480c3576e752e435cab70
2017-10-26Add an interface for bspatch readerTianjie Xu
Add a wrapper class to separate the patch read from data stream decompression. Therefore, bspatch will be able to process the patch that is compressed with various tools. Test: unittest pass Change-Id: I5214e0451bde80366e8a70b960703afb2b2a7d97