]> www.infradead.org Git - users/jedix/linux-maple.git/commit
lib: zstd: fix null-deref in ZSTD_createCDict_advanced2()
authorSergey Senozhatsky <senozhatsky@chromium.org>
Fri, 12 Jul 2024 05:18:14 +0000 (14:18 +0900)
committerAndrew Morton <akpm@linux-foundation.org>
Sat, 17 Aug 2024 00:52:27 +0000 (17:52 -0700)
commit9701a8a0dd9421f7788792958c66c46eb0c067f6
tree23a9c633aace5900ce375b937ea0552126d72322
parentaa384b9e3eff848fb7b8b96a6bff2028f77f13c6
lib: zstd: fix null-deref in ZSTD_createCDict_advanced2()

ZSTD_createCDict_advanced2() must ensure that
ZSTD_createCDict_advanced_internal() has successfully
allocated cdict.  customMalloc() may be called under
low memory condition and may be unable to allocate
workspace for cdict.

Link: https://lkml.kernel.org/r/20240712051850.484318-4-senozhatsky@chromium.org
Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
Cc: Nick Terrell <terrelln@fb.com>
Cc: Minchan Kim <minchan@kernel.org>
Cc: Nhat Pham <nphamcs@gmail.com>
Cc: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
lib/zstd/compress/zstd_compress.c