From b17fb488b0fd57e7b3c028a54ffd87c1f6878045 Mon Sep 17 00:00:00 2001 From: Yann Collet Date: Sat, 6 Jan 2018 20:50:36 +0100 Subject: [PATCH] fixed msan test a pointer calculation was wrong in a corner case --- lib/compress/zstd_lazy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compress/zstd_lazy.c b/lib/compress/zstd_lazy.c index 7261cffc..4af843d1 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;