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>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <74705394-8f7c-9635-12c0-10fed1fe8f8f@huawei.com>
Date:   Sat, 16 May 2020 15:22:41 +0800
From:   Yunfeng Ye <yeyunfeng@...wei.com>
To:     <haren@...ibm.com>, <linux-kernel@...r.kernel.org>,
        Shiyuan Hu <hushiyuan@...wei.com>,
        Hewenliang <hewenliang4@...wei.com>
Subject: [PATCH 2/2] lib: 842 - Remove useless checking in check_template()

A warning was found by smatch tool:
  "check_template() error: testing array offset 'c' after use."

Fix it by removing the useless checking in check_template().

Signed-off-by: Yunfeng Ye <yeyunfeng@...wei.com>
---
 lib/842/842_compress.c | 3 ---
 1 file changed, 3 deletions(-)

diff --git a/lib/842/842_compress.c b/lib/842/842_compress.c
index 18255d25781b..8d25345b4b49 100644
--- a/lib/842/842_compress.c
+++ b/lib/842/842_compress.c
@@ -379,9 +379,6 @@ static bool check_template(struct sw842_param *p, u8 c)
 	u8 *t = comp_ops[c];
 	int i, match, b = 0;

-	if (c >= OPS_MAX)
-		return false;
-
 	for (i = 0; i < 4; i++) {
 		if (t[i] & OP_ACTION_INDEX) {
 			if (t[i] & OP_AMOUNT_2)
-- 
1.8.3.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ