From: Jani Nikula <jani.nikula@linux.intel.com>
To: renpanpan <renpanpan@kylinos.cn>, linux-kernel@vger.kernel.org
Cc: rodrigo.vivi@intel.com, renpanpan <renpanpan@kylinos.cn>
Subject: Re: [PATCH 4/5] drm/i915/opregion: hda: Use safer strscpy() instead of strcpy()
Date: Tue, 10 Mar 2026 10:34:38 +0200 [thread overview]
Message-ID: <b06e120bdadda3fae806b7a55460d01f00762666@intel.com> (raw)
In-Reply-To: <20260310080457.3072560-1-renpanpan@kylinos.cn>
On Tue, 10 Mar 2026, renpanpan <renpanpan@kylinos.cn> wrote:
> Use a safer function strscpy() instead of strcpy() for copying to
> arrays.
> Only idiomatic code replacement, and no functional changes.
This is not true, and the change introduces a bug.
BR,
Jani.
>
> Signed-off-by: renpanpan <renpanpan@kylinos.cn>
> ---
> drivers/gpu/drm/i915/gvt/opregion.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/gpu/drm/i915/gvt/opregion.c b/drivers/gpu/drm/i915/gvt/opregion.c
> index d6e76ba31d60..e3bb7e0fcd9a 100644
> --- a/drivers/gpu/drm/i915/gvt/opregion.c
> +++ b/drivers/gpu/drm/i915/gvt/opregion.c
> @@ -151,7 +151,7 @@ static void virt_vbt_generation(struct vbt *v)
> v->header.vbt_size = sizeof(struct vbt);
> v->header.bdb_offset = offsetof(struct vbt, bdb_header);
>
> - strcpy(&v->bdb_header.signature[0], "BIOS_DATA_BLOCK");
> + strscpy(&v->bdb_header.signature[0], "BIOS_DATA_BLOCK");
> v->bdb_header.version = 186; /* child_dev_size = 33 */
> v->bdb_header.header_size = sizeof(v->bdb_header);
--
Jani Nikula, Intel
prev parent reply other threads:[~2026-03-10 8:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-03-10 8:04 renpanpan
2026-03-10 8:34 ` Jani Nikula [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=b06e120bdadda3fae806b7a55460d01f00762666@intel.com \
--to=jani.nikula@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=renpanpan@kylinos.cn \
--cc=rodrigo.vivi@intel.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
all inboxes | Powered by JetHome®