Commit 2bdc2c0e authored by Madhur Kumar's avatar Madhur Kumar Committed by Lyude Paul
Browse files

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: default avatarMadhur Kumar <madhurkumar004@gmail.com>
Reviewed-by: default avatarLyude Paul <lyude@redhat.com>
Fixes: 15a996bb ("drm/nouveau: assign fence_chan->name correctly")
Signed-off-by: default avatarLyude Paul <lyude@redhat.com>
Link: https://patch.msgid.link/20251204120822.17502-1-madhurkumar004@gmail.com
parent 479acb9d
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -183,11 +183,11 @@ nouveau_fence_context_new(struct nouveau_channel *chan, struct nouveau_fence_cha
	fctx->context = drm->runl[chan->runlist].context_base + chan->chid;

	if (chan == drm->cechan)
		strcpy(fctx->name, "copy engine channel");
		strscpy(fctx->name, "copy engine channel");
	else if (chan == drm->channel)
		strcpy(fctx->name, "generic kernel channel");
		strscpy(fctx->name, "generic kernel channel");
	else
		strcpy(fctx->name, cli->name);
		strscpy(fctx->name, cli->name);

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