From: WHR Date: Tue, 30 Apr 2024 16:40:38 +0000 (+0800) Subject: zfs: fix function 'zlib_decompress' pointlessly calling itself X-Git-Url: http://git.dujemihanovic.xyz/html/static/gitweb.css?a=commitdiff_plain;h=1466e065a94b3cd242f945f16c916a7f7da02985;p=u-boot.git zfs: fix function 'zlib_decompress' pointlessly calling itself In order to prevent crashing due to infinite recursion and actually decompress the requested data, call the zlib function 'uncompress' instead. Signed-off-by: WHR --- diff --git a/fs/zfs/zfs.c b/fs/zfs/zfs.c index 06221e68b3..9906d553fa 100644 --- a/fs/zfs/zfs.c +++ b/fs/zfs/zfs.c @@ -16,6 +16,7 @@ #include #include #include +#include #include "zfs_common.h" #include "div64.h" @@ -182,7 +183,8 @@ static int zlib_decompress(void *s, void *d, uint32_t slen, uint32_t dlen) { - if (zlib_decompress(s, d, slen, dlen) < 0) + uLongf z_dest_len = dlen; + if (uncompress(d, &z_dest_len, s, slen) != Z_OK) return ZFS_ERR_BAD_FS; return ZFS_ERR_NONE; }