From: "Cyrill Gorcunov" <gorcunov@gmail.com>
To: "Andrew Morton" <akpm@linux-foundation.org>
Cc: "Alexander Viro" <aviro@redhat.com>, LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] fs - fix name overwrite in __register_chrdev_region
Date: Tue, 16 Dec 2008 09:45:29 +0300 [thread overview]
Message-ID: <aa79d98a0812152245v49a183f8q6cdc2163e6797b2e@mail.gmail.com> (raw)
In-Reply-To: <20081215215706.7707315c.akpm@linux-foundation.org>
On Tue, Dec 16, 2008 at 8:57 AM, Andrew Morton
<akpm@linux-foundation.org> wrote:
>
> OK.
>
> strlcpy() prodces a more pleasing result:
>
> --- a/fs/char_dev.c~fs-fix-name-overwrite-in-__register_chrdev_region
> +++ a/fs/char_dev.c
> @@ -120,7 +120,7 @@ __register_chrdev_region(unsigned int ma
> cd->major = major;
> cd->baseminor = baseminor;
> cd->minorct = minorct;
> - strncpy(cd->name,name, 64);
> + strlcpy(cd->name, name, sizeof(cd->name));
>
> i = major_to_index(major);
>
> _
>
Thanks, Andrew!
prev parent reply other threads:[~2008-12-16 6:45 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-13 21:49 Cyrill Gorcunov
2008-12-16 5:57 ` Andrew Morton
2008-12-16 6:45 ` Cyrill Gorcunov [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=aa79d98a0812152245v49a183f8q6cdc2163e6797b2e@mail.gmail.com \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=aviro@redhat.com \
--cc=linux-kernel@vger.kernel.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
all inboxes | Powered by JetHome®