Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757511AbcBDXIe (ORCPT ); Thu, 4 Feb 2016 18:08:34 -0500 Received: from mail-pa0-f42.google.com ([209.85.220.42]:33195 "EHLO mail-pa0-f42.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757453AbcBDXI2 (ORCPT ); Thu, 4 Feb 2016 18:08:28 -0500 Date: Thu, 4 Feb 2016 15:07:56 -0800 From: Kees Cook To: Andrew Morton Cc: Andy Shevchenko , linux-kernel@vger.kernel.org Subject: [PATCH] lib-update-single-char-callers-of-strtobool fix Message-ID: <20160204230756.GA7011@www.outflux.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Drop needless buffer usage. Suggested-by: Andy Shevchenko Signed-off-by: Kees Cook --- 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