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: <20200119123659.29950-1-chenzhou10@huawei.com>
Date:   Sun, 19 Jan 2020 20:36:59 +0800
From:   Chen Zhou <chenzhou10@...wei.com>
To:     <keescook@...omium.org>, <arnd@...db.de>,
        <gregkh@...uxfoundation.org>
CC:     <linux-kernel@...r.kernel.org>, <chenzhou10@...wei.com>
Subject: [PATCH -next] lkdtm: remove unnecessary terminated-null assign

scnprintf implementation of kernel guarantees that its result is
terminated with null byte if size is larger than 0. So we don't need
to set terminated-null again.

Signed-off-by: Chen Zhou <chenzhou10@...wei.com>
---
 drivers/misc/lkdtm/core.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c
index ee0d6e7..5ad2630 100644
--- a/drivers/misc/lkdtm/core.c
+++ b/drivers/misc/lkdtm/core.c
@@ -341,7 +341,6 @@ static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf,
 		n += scnprintf(buf + n, PAGE_SIZE - n, "%s\n",
 			      crashtypes[i].name);
 	}
-	buf[n] = '\0';
 
 	out = simple_read_from_buffer(user_buf, count, off,
 				      buf, n);
-- 
2.7.4

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ