mirror of
https://github.com/u-boot/u-boot.git
synced 2025-04-16 09:54:35 +00:00
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 <msl0000023508@gmail.com>
This commit is contained in:
parent
cd85e0d443
commit
1466e065a9
1 changed files with 3 additions and 1 deletions
|
@ -16,6 +16,7 @@
|
|||
#include <linux/time.h>
|
||||
#include <linux/ctype.h>
|
||||
#include <asm/byteorder.h>
|
||||
#include <u-boot/zlib.h>
|
||||
#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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue