Skip to content

Commit 2bdc2c0

Browse files
MadhurKumar004Lyude
authored andcommitted
drm/nouveau: refactor deprecated strcpy
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
1 parent 479acb9 commit 2bdc2c0

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)