Fix off-by-one in LZ decoder.
authorLasse Collin <lasse.collin@tukaani.org>
Fri, 10 Apr 2009 08:17:02 +0000 (11:17 +0300)
committerLasse Collin <lasse.collin@tukaani.org>
Fri, 10 Apr 2009 08:17:02 +0000 (11:17 +0300)
Fortunately, this bug had no security risk other than accepting
some corrupt files as valid.

src/liblzma/lz/lz_decoder.h

index 9041d0b..79b8c8c 100644 (file)
@@ -126,7 +126,7 @@ dict_is_empty(const lzma_dict *const dict)
 static inline bool
 dict_is_distance_valid(const lzma_dict *const dict, const size_t distance)
 {
-       return dict->full >= distance;
+       return dict->full > distance;
 }