From: W. Felix Handte Date: Wed, 23 May 2018 20:45:58 +0000 (-0400) Subject: Fix Off-By-One Error X-Git-Tag: v1.3.5~3^2~37^2~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec7efe88f5dc9d86049651ce6d367d051fc00f12;p=thirdparty%2Fzstd.git Fix Off-By-One Error --- diff --git a/lib/compress/zstd_double_fast.c b/lib/compress/zstd_double_fast.c index 711bf41ab..b862289bb 100644 --- a/lib/compress/zstd_double_fast.c +++ b/lib/compress/zstd_double_fast.c @@ -169,7 +169,7 @@ size_t ZSTD_compressBlock_doubleFast_generic( U32 const dictMatchIndexL3 = dictHashLong[hl3]; const BYTE* dictMatchL3 = dictBase + dictMatchIndexL3; assert(dictMatchL3 < dictEnd); - if (dictMatchL3 > dictLowest && MEM_read64(dictMatchL3) == MEM_read64(ip)) { + if (dictMatchL3 > dictLowest && MEM_read64(dictMatchL3) == MEM_read64(ip+1)) { mLength = ZSTD_count_2segments(ip+1+8, dictMatchL3+8, iend, dictEnd, prefixLowest) + 8; ip++; offset = (U32)(current + 1 - dictMatchIndexL3 - dictIndexDelta);