[PATCH 5/5] drm/vmwgfx/msg: hda: Use safer strscpy() instead of strcpy()
From: renpanpan
Date: Tue Mar 10 2026 - 04:09:19 EST
Use a safer function strscpy() instead of strcpy() for copying to
arrays.
Only idiomatic code replacement, and no functional changes.
Signed-off-by: renpanpan <renpanpan@xxxxxxxxxx>
---
drivers/gpu/drm/vmwgfx/vmwgfx_msg.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
index fd77ab6568cb..4b675bec7e81 100644
--- a/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
+++ b/drivers/gpu/drm/vmwgfx/vmwgfx_msg.c
@@ -666,8 +666,8 @@ static inline char *mksstat_init_record_time(mksstat_kern_stats_t stat_idx,
MKSGuestStatCounterTime *pstat, MKSGuestStatInfoEntry *pinfo, char *pstrs)
{
char *const pstrd = pstrs + strlen(mksstat_kern_name_desc[stat_idx][0]) + 1;
- strcpy(pstrs, mksstat_kern_name_desc[stat_idx][0]);
- strcpy(pstrd, mksstat_kern_name_desc[stat_idx][1]);
+ strscpy(pstrs, mksstat_kern_name_desc[stat_idx][0]);
+ strscpy(pstrd, mksstat_kern_name_desc[stat_idx][1]);
pinfo[stat_idx].name.s = pstrs;
pinfo[stat_idx].description.s = pstrd;
--
2.25.1