From: Hans de Goede <hdegoede@redhat.com>
To: yang.yang29@zte.com.cn
Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
xu.panda@zte.com.cn
Subject: Re: [PATCH linux-next] vboxfs: use strscpy() is more robust and safer
Date: Tue, 22 Nov 2022 15:44:10 +0100 [thread overview]
Message-ID: <8648a01c-ee70-7c69-f24c-3a30866ae08f@redhat.com> (raw)
In-Reply-To: <202211220858139474929@zte.com.cn>
Hi,
On 11/22/22 01:58, yang.yang29@zte.com.cn wrote:
> From: Xu Panda <xu.panda@zte.com.cn>
>
> The implementation of strscpy() is more robust and safer.
> That's now the recommended way to copy NUL terminated strings.
>
> Signed-off-by: Xu Panda <xu.panda@zte.com.cn>
> Signed-off-by: Yang Yang <yang.yang29@zte.com>
Thanks, patch looks good to me:
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Regards,
Hans
> ---
> fs/vboxsf/super.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/fs/vboxsf/super.c b/fs/vboxsf/super.c
> index d2f6df69f611..1fb8f4df60cb 100644
> --- a/fs/vboxsf/super.c
> +++ b/fs/vboxsf/super.c
> @@ -176,7 +176,7 @@ static int vboxsf_fill_super(struct super_block *sb, struct fs_context *fc)
> }
> folder_name->size = size;
> folder_name->length = size - 1;
> - strlcpy(folder_name->string.utf8, fc->source, size);
> + strscpy(folder_name->string.utf8, fc->source, size);
> err = vboxsf_map_folder(folder_name, &sbi->root);
> kfree(folder_name);
> if (err) {
prev parent reply other threads:[~2022-11-22 14:45 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-22 0:58 [PATCH linux-next] vboxfs: use strscpy() is more robust and safer yang.yang29
2022-11-22 14:44 ` Hans de Goede [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=8648a01c-ee70-7c69-f24c-3a30866ae08f@redhat.com \
--to=hdegoede@redhat.com \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=xu.panda@zte.com.cn \
--cc=yang.yang29@zte.com.cn \
/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).