linux-xfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Bill O'Donnell <billodo@redhat.com>
To: "Darrick J. Wong" <darrick.wong@oracle.com>
Cc: Eric Sandeen <sandeen@redhat.com>, xfs <linux-xfs@vger.kernel.org>
Subject: Re: [PATCH] xfs_io: fix null pointer deref when complaining about scrub command
Date: Thu, 31 May 2018 09:55:34 -0500	[thread overview]
Message-ID: <20180531145534.GA1268@redhat.com> (raw)
In-Reply-To: <20180530033215.GO30110@magnolia>

On Tue, May 29, 2018 at 08:32:15PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Don't increment optind until we've validated that argv[optind] is a
> valid scrub/repair subcommand and do not need to complain about
> argv[optind].
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> ---
>  io/scrub.c |    3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/io/scrub.c b/io/scrub.c
> index 604daed9..37ffe46b 100644
> --- a/io/scrub.c
> +++ b/io/scrub.c
> @@ -166,12 +166,11 @@ parse_args(
>  			break;
>  		}
>  	}
> -	optind++;
> -
>  	if (type < 0) {
>  		printf(_("Unknown type '%s'.\n"), argv[optind]);
>  		return command_usage(cmdinfo);
>  	}
> +	optind++;
>  
>  	switch (d->type) {
>  	case ST_INODE:
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

      parent reply	other threads:[~2018-05-31 14:55 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-30  3:32 [PATCH] xfs_io: fix null pointer deref when complaining about scrub command Darrick J. Wong
2018-05-31 14:52 ` Eric Sandeen
2018-05-31 14:55 ` Bill O'Donnell [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180531145534.GA1268@redhat.com \
    --to=billodo@redhat.com \
    --cc=darrick.wong@oracle.com \
    --cc=linux-xfs@vger.kernel.org \
    --cc=sandeen@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).