[libzstd] Fix ZSTD_decompressBound() on bad skippable frames
The function didn't verify that the skippable frame size is correct.
This commit is contained in:
1 parent
b85f7d7790
commit
450feb0f95
2 files changed
+8
-1
No files matched your search
@@ -238,6 +238,10 @@ MEM_STATIC ZSTD_frameSizeInfo ZSTD_findFrameSizeInfoLegacy(const void *src, size
|
||||
frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;
|
||||
break;
|
||||
}
|
||||
if (frameSizeInfo.compressedSize > srcSize) {
|
||||
frameSizeInfo.compressedSize = ERROR(srcSize_wrong);
|
||||
frameSizeInfo.decompressedBound = ZSTD_CONTENTSIZE_ERROR;
|
||||
}
|
||||
return frameSizeInfo;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user