From: Yann Collet Date: Wed, 11 May 2016 09:07:54 +0000 (+0200) Subject: fixed minor asan warning in legacy decoder X-Git-Tag: v0.6.1^2~12 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=3329d98df9b28621f178ee9131d278f3b6c4b9e4;p=thirdparty%2Fzstd.git fixed minor asan warning in legacy decoder --- diff --git a/lib/legacy/zstd_v05.c b/lib/legacy/zstd_v05.c index 6425ad2cc..42e925c42 100644 --- a/lib/legacy/zstd_v05.c +++ b/lib/legacy/zstd_v05.c @@ -2885,8 +2885,7 @@ size_t HUFv05_decompress (void* dst, size_t dstSize, const void* cSrc, size_t cS /* validation checks */ if (dstSize == 0) return ERROR(dstSize_tooSmall); - if (cSrcSize > dstSize) return ERROR(corruption_detected); /* invalid */ - if (cSrcSize == dstSize) { memcpy(dst, cSrc, dstSize); return dstSize; } /* not compressed */ + if (cSrcSize >= dstSize) return ERROR(corruption_detected); /* invalid, or not compressed, but not compressed already dealt with */ if (cSrcSize == 1) { memset(dst, *(const BYTE*)cSrc, dstSize); return dstSize; } /* RLE */ /* decoder timing evaluation */