From: W. Felix Handte Date: Thu, 19 Apr 2018 23:36:34 +0000 (-0400) Subject: Fix Signedness of Comparison X-Git-Tag: upstream/1.9.3~8^2~25^2^2~18 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=14c577d4c9332197dc0003833e043608b4b4b239;p=platform%2Fupstream%2Flz4.git Fix Signedness of Comparison --- diff --git a/lib/lz4hc.c b/lib/lz4hc.c index 9a02787..20df8fa 100644 --- a/lib/lz4hc.c +++ b/lib/lz4hc.c @@ -308,7 +308,7 @@ LZ4HC_InsertAndGetWiderMatch ( ptrdiff_t dictIndexDelta = dictCtx->base - dictCtx->end + lowLimit; dictMatchIndex = dictCtx->hashTable[LZ4HC_hashPtr(ip)]; matchIndex = dictMatchIndex + (int)dictIndexDelta; - while (dictMatchIndex + MAX_DISTANCE > ip - base - dictIndexDelta && nbAttempts--) { + while ((ptrdiff_t) dictMatchIndex + MAX_DISTANCE > ip - base - dictIndexDelta && nbAttempts--) { const BYTE* const matchPtr = dictCtx->base + dictMatchIndex; if (LZ4_read32(matchPtr) == pattern) {