1
0
mirror of https://github.com/facebook/zstd.git synced 2024-12-12 13:25:34 +02:00

Compare commits

...

4 Commits

Author SHA1 Message Date
Yann Collet
82d470564d
Merge pull request #4201 from rorosen/seek-table-create-null-check
prevent possible segfault when creating seek table
2024-11-26 17:59:42 -08:00
Yann Collet
2b36d4bc1c
Merge pull request #4202 from nhz2/fix-compressBound-typo
Fix typo in ZSTD_compressBound docs
2024-11-26 17:59:25 -08:00
Robert Rose
b683c0dbe2 prevent possible segfault when creating seek table
Add a check whether the seek table of a `ZSTD_seekable` is initialized
before creating a new seek table from it. Return `NULL`, if the check
fails.
2024-11-25 08:57:25 +01:00
nhz2
10beb7cb53 Fix typo in ZSTD_compressBound docs 2024-11-24 19:05:15 -05:00
2 changed files with 3 additions and 1 deletions

View File

@ -252,6 +252,8 @@ size_t ZSTD_seekable_free(ZSTD_seekable* zs)
ZSTD_seekTable* ZSTD_seekTable_create_fromSeekable(const ZSTD_seekable* zs)
{
assert(zs != NULL);
if (zs->seekTable.entries == NULL) return NULL;
ZSTD_seekTable* const st = (ZSTD_seekTable*)malloc(sizeof(ZSTD_seekTable));
if (st==NULL) return NULL;

View File

@ -224,7 +224,7 @@ ZSTDLIB_API size_t ZSTD_findFrameCompressedSize(const void* src, size_t srcSize)
* it's recommended to provide @dstCapacity >= ZSTD_compressBound(srcSize)
* as it eliminates one potential failure scenario,
* aka not enough room in dst buffer to write the compressed frame.
* Note : ZSTD_compressBound() itself can fail, if @srcSize > ZSTD_MAX_INPUT_SIZE .
* Note : ZSTD_compressBound() itself can fail, if @srcSize >= ZSTD_MAX_INPUT_SIZE .
* In which case, ZSTD_compressBound() will return an error code
* which can be tested using ZSTD_isError().
*