From: Yann Collet Date: Sat, 6 Jan 2018 19:50:36 +0000 (+0100) Subject: fixed msan test X-Git-Tag: v1.3.4~1^2~87^2~2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b17fb488b0fd57e7b3c028a54ffd87c1f6878045;p=thirdparty%2Fzstd.git fixed msan test a pointer calculation was wrong in a corner case --- diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c index 7261cffcf..4af843d1b 100644 --- a/lib/compress/zstd_lazy.c +++ b/lib/compress/zstd_lazy.c @@ -122,7 +122,7 @@ static void ZSTD_insertDUBT1(ZSTD_CCtx* zc, if ( (!extDict) || (matchIndex+matchLength >= dictLimit) /* both in current segment*/ || (current < dictLimit) /* both in extDict */) { - const BYTE* const mBase = !extDict || (matchIndex >= dictLimit) ? base : dictBase; + const BYTE* const mBase = !extDict || ((matchIndex+matchLength) >= dictLimit) ? base : dictBase; assert( (matchIndex+matchLength >= dictLimit) /* might be wrong if extDict is incorrectly set to 0 */ || (current < dictLimit) ); match = mBase + matchIndex;