Linux CIFS filesystem development
 help / color / mirror / Atom feed
From: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
To: Steve French <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: CIFS <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
	Pavel Shilovsky
	<piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Subject: Re: [PATCH] cifscreds: check optind before accessing argv[optind]
Date: Mon, 22 Jan 2018 19:57:40 -0500 (EST)	[thread overview]
Message-ID: <1836982403.1740018.1516669060551.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <CAH2r5ms-rpxf5E_XZc1W+h1tMmV26WEbXWCxEfYa+cA7PX-VTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>





----- Original Message -----
> From: "Steve French" <smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> To: "Ronnie Sahlberg" <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> Cc: "CIFS" <linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>, "Pavel Shilovsky" <piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
> Sent: Tuesday, 23 January, 2018 11:50:38 AM
> Subject: Re: [PATCH] cifscreds: check optind before accessing argv[optind]
> 
> I would like to add cc stable. Ok?

SGTM

> 
> On Jan 22, 2018 18:48, "Ronnie Sahlberg" <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org> wrote:
> 
> > Redhat bugzilla: 1278543
> >
> > This fixes a segfault for some incorrect usage, for example
> >    cifscreds -u test
> >
> > Signed-off-by: Ronnie Sahlberg <lsahlber-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
> > ---
> >  cifscreds.c | 3 +++
> >  1 file changed, 3 insertions(+)
> >
> > diff --git a/cifscreds.c b/cifscreds.c
> > index 5d84c3c..32f2ee4 100644
> > --- a/cifscreds.c
> > +++ b/cifscreds.c
> > @@ -487,6 +487,9 @@ int main(int argc, char **argv)
> >                 }
> >         }
> >
> > +       if (optind >= argc)
> > +               return usage();
> > +
> >         /* find the best fit command */
> >         best = NULL;
> >         n = strnlen(argv[optind], MAX_COMMAND_SIZE);
> > --
> > 2.15.1
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-cifs" in
> > the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >
> 

  parent reply	other threads:[~2018-01-23  0:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-01-23  0:48 [PATCH] cifscreds: check optind before accessing argv[optind] Ronnie Sahlberg
     [not found] ` <CAH2r5ms-rpxf5E_XZc1W+h1tMmV26WEbXWCxEfYa+cA7PX-VTw@mail.gmail.com>
     [not found]   ` <CAH2r5ms-rpxf5E_XZc1W+h1tMmV26WEbXWCxEfYa+cA7PX-VTw-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2018-01-23  0:57     ` Ronnie Sahlberg [this message]
     [not found]       ` <1836982403.1740018.1516669060551.JavaMail.zimbra-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2018-01-23  0:59         ` Steve French

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=1836982403.1740018.1516669060551.JavaMail.zimbra@redhat.com \
    --to=lsahlber-h+wxahxf7alqt0dzr+alfa@public.gmane.org \
    --cc=linux-cifs-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=piastryyy-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=smfrench-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    /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