lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <183a194e5b2.b4c21f801465428.4840337107644927802@elijahpepe.com>
Date:   Mon, 03 Oct 2022 23:00:33 -0700
From:   Elijah Conners <business@...jahpepe.com>
To:     "linux-kernel" <linux-kernel@...r.kernel.org>
Cc:     "torvalds" <torvalds@...ux-foundation.org>,
        "akpm" <akpm@...ux-foundation.org>
Subject: [PATCH] lib/zlib: define rc

The __gunzip() and zlib_inflate_blob() functions refer to the
zlib_inflateEnd() function, although this function has no side effects.
In the former's case, it's likely that rc (the result of the function)
was meant to be set to the the result of zlib_inflateEnd(), while
zlib_inflate_blob() has no use for this function in rc.

Signed-off-by: Elijah Conners <business@...jahpepe.com>
---
 lib/decompress_inflate.c   | 2 +-
 lib/zlib_inflate/infutil.c | 1 -
 2 files changed, 1 insertion(+), 2 deletions(-)

diff --git a/lib/decompress_inflate.c b/lib/decompress_inflate.c
index 6130c42b8e59..df03d1919925 100644
--- a/lib/decompress_inflate.c
+++ b/lib/decompress_inflate.c
@@ -177,7 +177,7 @@ STATIC int INIT __gunzip(unsigned char *buf, long len,
 		}
 	}
 
-	zlib_inflateEnd(strm);
+	rc = zlib_inflateEnd(strm);
 	if (pos)
 		/* add + 8 to skip over trailer */
 		*pos = strm->next_in - zbuf+8;
diff --git a/lib/zlib_inflate/infutil.c b/lib/zlib_inflate/infutil.c
index 4824c2cc7a09..588839fff01d 100644
--- a/lib/zlib_inflate/infutil.c
+++ b/lib/zlib_inflate/infutil.c
@@ -37,7 +37,6 @@ int zlib_inflate_blob(void *gunzip_buf, unsigned int sz,
 			rc = sz - strm->avail_out;
 		else
 			rc = -EINVAL;
-		zlib_inflateEnd(strm);
 	} else
 		rc = -EINVAL;
 
-- 
2.29.2.windows.2

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ