Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1327320 > unrolled thread

[PATCH] lib-update-single-char-callers-of-strtobool fix

Started byKees Cook <keescook@chromium.org>
First post2016-02-05 00:10 +0100
Last post2016-02-05 00:10 +0100
Articles 1 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCH] lib-update-single-char-callers-of-strtobool fix Kees Cook <keescook@chromium.org> - 2016-02-05 00:10 +0100

#1327320 — [PATCH] lib-update-single-char-callers-of-strtobool fix

FromKees Cook <keescook@chromium.org>
Date2016-02-05 00:10 +0100
Subject[PATCH] lib-update-single-char-callers-of-strtobool fix
Message-ID<qYBcf-i9-51@gated-at.bofh.it>
Drop needless buffer usage.

Suggested-by: Andy Shevchenko <andy.shevchenko@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
---
 fs/cifs/cifs_debug.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
index 6ee59abcb69b..bd61c01e652b 100644
--- a/fs/cifs/cifs_debug.c
+++ b/fs/cifs/cifs_debug.c
@@ -596,7 +596,6 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
 	int rc;
 	unsigned int flags;
 	char flags_string[12];
-	char c[2] = { '\0' };
 	bool bv;
 
 	if ((count < 1) || (count > 11))
@@ -609,11 +608,10 @@ static ssize_t cifs_security_flags_proc_write(struct file *file,
 
 	if (count < 3) {
 		/* single char or single char followed by null */
-		c[0] = flags_string[0];
-		if (strtobool(c, &bv) == 0) {
+		if (strtobool(flags_string, &bv) == 0) {
 			global_secflags = bv ? CIFSSEC_MAX : CIFSSEC_DEF;
 			return count;
-		} else if (!isdigit(c[0])) {
+		} else if (!isdigit(flags_string[0])) {
 			cifs_dbg(VFS, "Invalid SecurityFlags: %s\n",
 					flags_string);
 			return -EINVAL;
-- 
2.6.3


-- 
Kees Cook
Chrome OS & Brillo Security

[toc] | [standalone]


Back to top | Article view | linux.kernel


csiph-web