mirror of
https://github.com/facebook/zstd.git
synced 2025-11-27 00:05:09 -05:00
Merge pull request #4201 from rorosen/seek-table-create-null-check
prevent possible segfault when creating seek table
This commit is contained in:
commit
82d470564d
@ -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;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user