Skip to content

Commit b17fb48

Browse files
committed
fixed msan test
a pointer calculation was wrong in a corner case
1 parent 658d6b8 commit b17fb48

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/compress/zstd_lazy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ static void ZSTD_insertDUBT1(ZSTD_CCtx* zc,
122122
if ( (!extDict)
123123
|| (matchIndex+matchLength >= dictLimit) /* both in current segment*/
124124
|| (current < dictLimit) /* both in extDict */) {
125-
const BYTE* const mBase = !extDict || (matchIndex >= dictLimit) ? base : dictBase;
125+
const BYTE* const mBase = !extDict || ((matchIndex+matchLength) >= dictLimit) ? base : dictBase;
126126
assert( (matchIndex+matchLength >= dictLimit) /* might be wrong if extDict is incorrectly set to 0 */
127127
|| (current < dictLimit) );
128128
match = mBase + matchIndex;

0 commit comments

Comments
 (0)