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


Groups > linux.kernel > #1320191

Re: [PATCH] lib: fix callers of strtobool to use char array

From Joe Perches <joe@perches.com>
Newsgroups linux.kernel
Subject Re: [PATCH] lib: fix callers of strtobool to use char array
Date 2016-01-28 02:00 +0100
Message-ID <qVJ6i-3DX-15@gated-at.bofh.it> (permalink)
References <qVIWC-3zl-21@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 2016-01-27 at 16:45 -0800, Kees Cook wrote:
> Some callers of strtobool were passing a pointer to unterminated strings.
> This fixes the issue and consolidates some logic in cifs.

This may be incomplete as it duplicates the behavior for
the old number of characters, but this is not a solution
for the entry of a bool that is "on" or "off".

> diff --git a/fs/cifs/cifs_debug.c b/fs/cifs/cifs_debug.c
[]
> @@ -290,7 +305,8 @@ static ssize_t cifs_stats_proc_write(struct file *file,
>  			}
>  		}
>  		spin_unlock(&cifs_tcp_ses_lock);
> -	}
> +	} else
> +		return rc;

Likely better to reverse the test and unindent the
preceding block.

Otherwise, please make sure to use the general brace
form of when one branch needs braces, the other branch
should have them too.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] lib: fix callers of strtobool to use char array Kees Cook <keescook@chromium.org> - 2016-01-28 01:50 +0100
  Re: [PATCH] lib: fix callers of strtobool to use char array Joe Perches <joe@perches.com> - 2016-01-28 02:00 +0100
    Re: [PATCH] lib: fix callers of strtobool to use char array Kees Cook <keescook@chromium.org> - 2016-01-28 02:10 +0100

csiph-web