mirror of
https://github.com/privatevoid-net/nix-super.git
synced 2024-11-10 08:16:15 +02:00
Don't hang in decompression if bzip2 data ends prematurely
This commit is contained in:
parent
aa23bba27f
commit
ed5c0f69f2
1 changed files with 6 additions and 0 deletions
|
@ -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");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue