Merge pull request #1446 from terrelln/overflow

[libzstd] Fix infinite loop in decompression
This commit is contained in:
Nick Terrell authored and GitHub committed 2018-12-13 16:21:15 -08:00
commit 75fa3f2eb7
2 files changed
+30 -11

No files matched your search

+8
View File
@@ -353,6 +353,14 @@ static int basicUnitTests(U32 seed, double compressibility)
ZSTD_freeCCtx(cctx);
}
DISPLAYLEVEL(3, "test%3i : decompress skippable frame -8 size : ", testNb++);
{
char const skippable8[] = "\x50\x2a\x4d\x18\xf8\xff\xff\xff";
size_t const size = ZSTD_decompress(NULL, 0, skippable8, 8);
if (!ZSTD_isError(size)) goto _output_error;
}
DISPLAYLEVEL(3, "OK \n");
DISPLAYLEVEL(3, "test%3i : ZSTD_getFrameContentSize test : ", testNb++);
{ unsigned long long const rSize = ZSTD_getFrameContentSize(compressedBuffer, cSize);