Util: Fix decompression of compressed zero bytes (ticket #2770)

This commit is contained in:
zzz
2020-09-02 15:57:04 +00:00
parent 4863ab3711
commit ceb0749e0d

View File

@ -1902,7 +1902,8 @@ public class DataHelper {
*/
public static byte[] decompress(byte orig[], int offset, int length) throws IOException {
if (orig == null) return orig;
if (length < 23)
// normal overhead is 23 bytes, but a compress of zero bytes is 20 bytes
if (length < 20)
throw new IOException("length");
if (length < 65559 && orig[offset + 10] == 0x01)
return zeroDecompress(orig, offset, length);