Skip to contentSkip to conversation

lib-update-single-char-callers-of-strtobool fix

PATCH New Kees Cook 1 participant 1 message Feb 4, 2016

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH 1/1 lib-update-single-char-callers-of-strtobool fix

Drop needless buffer usage.

---
 fs/cifs/cifs_debug.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
fs/cifs/cifs_debug.c +2 -4
index 6ee59abcb69b..bd61c01e652b 100644
@@ -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;
Signature · 6 lines
2.6.3


-- 
Kees Cook
Chrome OS & Brillo Security