Check distance > 0 for decode_huffman_slow

decode_huffman_fast already does this. The slow flavor should too.

Updates https://bugs.chromium.org/p/oss-fuzz/issues/detail?id=6524
This commit is contained in:
Nigel Tao committed 2018-02-24 11:31:12 +11:00
1 parent b059480f66
commit bbc3d34e1b
3 files changed
+12

No files matched your search

+5
View File
@@ -2645,6 +2645,11 @@ static wuffs_deflate__status wuffs_deflate__decoder__decode_huffman_slow(
v_bits >>= v_table_entry_n_bits;
v_n_bits -= v_table_entry_n_bits;
}
if (v_distance <= 0) {
status =
WUFFS_DEFLATE__ERROR_INTERNAL_ERROR_INCONSISTENT_HUFFMAN_DECODER_STATE;
goto exit;
}
v_n_copied = 0;
while (true) {
if (((uint64_t)(v_distance)) >