public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Dan Carpenter <dan.carpenter@oracle.com>
To: Rickard Strandqvist <rickard_strandqvist@spectrumdigital.se>
Cc: devel@driverdev.osuosl.org,
	Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	Monam Agarwal <monamagarwal123@gmail.com>
Subject: Re: [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate
Date: Tue, 17 Jun 2014 08:56:09 +0300	[thread overview]
Message-ID: <20140617055609.GK5500@mwanda> (raw)
In-Reply-To: <CAFo99gaUmL1_BYeWSBnzpDFWOoJKmmvhG_wVw-5F9fj-7EpufA@mail.gmail.com>

On Tue, Jun 17, 2014 at 12:14:18AM +0200, Rickard Strandqvist wrote:
> 2014-06-16 21:09 GMT+02:00 Dan Carpenter <dan.carpenter@oracle.com>:
> > On Mon, Jun 16, 2014 at 10:01:14PM +0300, Dan Carpenter wrote:
> >>
> >> No one calls U14DriverName() so just delete this function.
> >
> > Oh.  This is a userspace library or something?  I'm not sure what to do.
> >
> > How did you compile test this?  Does your platform even provide
> > strlcpy()?
> >
> > Anyway, don't delete it like I said, but I still don't think your patch
> > helps here.
> >
> > regards,
> > dan carpenter
> >
> 
> Hi
> 
> I saw that these functions are not used, had planned type it in the
> cover letter to :-(
> 
> Thought of userspec, but then it should definitely ensure the NULL char?

The strings are always 4 characters long.  If the user start passing 3
character buffers then it will *never* work.  That means the bug will be
caught on the first run in testing.

I don't worry about those kinds of bugs very much.  It's only a concern
if it works 99 times and fails 1 time.

regards,
dan carpenter

      reply	other threads:[~2014-06-17  5:56 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-14 22:41 [PATCH] staging: ced1401: userspace: use1401.c: Cleaning up potential strncpy missing null-terminate Rickard Strandqvist
2014-06-14 22:41 ` Rickard Strandqvist
2014-06-16 19:01   ` Dan Carpenter
2014-06-16 19:09     ` Dan Carpenter
2014-06-16 22:14       ` Rickard Strandqvist
2014-06-17  5:56         ` Dan Carpenter [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=20140617055609.GK5500@mwanda \
    --to=dan.carpenter@oracle.com \
    --cc=devel@driverdev.osuosl.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=monamagarwal123@gmail.com \
    --cc=rickard_strandqvist@spectrumdigital.se \
    /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