Skip to content

Commit 731e1be

Browse files
MadhurKumar004gregkh
authored andcommitted
drm/nouveau: refactor deprecated strcpy
[ Upstream commit 2bdc2c0 ] strcpy() has been deprecated because it performs no bounds checking on the destination buffer, which can lead to buffer overflows. Use the safer strscpy() instead. Signed-off-by: Madhur Kumar <madhurkumar004@gmail.com> Reviewed-by: Lyude Paul <lyude@redhat.com> Fixes: 15a996b ("drm/nouveau: assign fence_chan->name correctly") Signed-off-by: Lyude Paul <lyude@redhat.com> Link: https://patch.msgid.link/20251204120822.17502-1-madhurkumar004@gmail.com Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent cdda0d0 commit 731e1be

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

drivers/gpu/drm/nouveau/nouveau_fence.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -183,11 +183,11 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_cha
183183
fctx->context = drm->runl[chan->runlist].context_base + chan->chid;
184184

185185
if (chan == drm->cechan)
186-
strcpy(fctx->name, "copy engine channel");
186+
strscpy(fctx->name, "copy engine channel");
187187
else if (chan == drm->channel)
188-
strcpy(fctx->name, "generic kernel channel");
188+
strscpy(fctx->name, "generic kernel channel");
189189
else
190-
strcpy(fctx->name, cli->name);
190+
strscpy(fctx->name, cli->name);
191191

192192
kref_init(&fctx->fence_ref);
193193
if (!priv->uevent)

0 commit comments

Comments
 (0)