From 31272acaf4e37c6fdfbb587b69063520f661487c Mon Sep 17 00:00:00 2001 From: Michihiro NAKAJIMA Date: Thu, 3 Jul 2014 20:26:43 +0900 Subject: [PATCH] Fix a bug in lha read format. The bug was it could not correctly extract the compressed data which had just one repated pattern. --- libarchive/archive_read_support_format_lha.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libarchive/archive_read_support_format_lha.c b/libarchive/archive_read_support_format_lha.c index 3c565c001..66fd927cc 100644 --- a/libarchive/archive_read_support_format_lha.c +++ b/libarchive/archive_read_support_format_lha.c @@ -2743,7 +2743,7 @@ lzh_decode_huffman(struct huffman *hf, unsigned rbits) * If it fails, search a huffman tree for. */ c = hf->tbl[rbits >> hf->shift_bits]; - if (c < hf->len_avail) + if (c < hf->len_avail || hf->len_avail == 0) return (c); /* This bit pattern needs to be found out at a huffman tree. */ return (lzh_decode_huffman_tree(hf, rbits, c)); -- 2.47.2