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: <1422624772-20285-1-git-send-email-linux@rasmusvillemoes.dk>
Date:	Fri, 30 Jan 2015 14:32:52 +0100
From:	Rasmus Villemoes <linux@...musvillemoes.dk>
To:	Eric Biederman <ebiederm@...ssion.com>
Cc:	Rasmus Villemoes <linux@...musvillemoes.dk>,
	kexec@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] kernel/kexec.c: Use strchrnul

strchrnul exists precisely for this use case.

Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
---
 kernel/kexec.c | 5 +----
 1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/kernel/kexec.c b/kernel/kexec.c
index 9a8a01abbaed..70e7050f7ab9 100644
--- a/kernel/kexec.c
+++ b/kernel/kexec.c
@@ -1792,12 +1792,9 @@ static __init char *get_last_crashkernel(char *cmdline,
 	/* find crashkernel and use the last one if there are more */
 	p = strstr(p, name);
 	while (p) {
-		char *end_p = strchr(p, ' ');
+		char *end_p = strchrnul(p, ' ');
 		char *q;
 
-		if (!end_p)
-			end_p = p + strlen(p);
-
 		if (!suffix) {
 			int i;
 
-- 
2.1.3

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ