Merge pull request #972 from jasperla/memmove_crash

Fix potential memory corruption with negative memmove() size
This commit is contained in:
Yann Collet 2021-04-30 08:56:25 -07:00 committed by GitHub
commit 7a966c1511
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1749,7 +1749,7 @@ LZ4_decompress_generic(
const size_t dictSize /* note : = 0 if noDict */
)
{
if (src == NULL) { return -1; }
if ((src == NULL) || (outputSize < 0)) { return -1; }
{ const BYTE* ip = (const BYTE*) src;
const BYTE* const iend = ip + srcSize;