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  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Sat, 16 May 2020 15:21:40 +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 1/2] lib: 842 - Remove useless checking in add_template()

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

Fix it by removing the useless checking in add_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 c02baa4168e1..18255d25781b 100644
--- a/lib/842/842_compress.c
+++ b/lib/842/842_compress.c
@@ -225,9 +225,6 @@ static int add_template(struct sw842_param *p, u8 c)
 	u8 *t = comp_ops[c];
 	bool inv = false;

-	if (c >= OPS_MAX)
-		return -EINVAL;
-
 	pr_debug("template %x\n", t[4]);

 	ret = add_bits(p, t[4], OP_BITS);
-- 
1.8.3.1

Powered by blists - more mailing lists