mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] media: siano: Replace strlcat() with snprintf() in sms_ir_init()
@ 2026-11-04  9:02 Mariia Nikitash
  2026-11-04 11:25 ` Alejandro Colomar
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Mariia Nikitash @ 2026-11-04  9:02 UTC (permalink / raw)
  To: mchehab
  Cc: linux-media, linux-kernel, linux-hardening, kees, justinstitt,
	morbo, Mariia Nikitash

In preparation for removing the deprecated strlcat() API[1],
replace the strscpy() and strlcat() calls with a single snprintf()
call to construct the IR device path.

Both the source and destination buffers have the same capacity,
and the return values are unused. This preserves the resulting
string, including truncation behavior.

Link: https://github.com/KSPP/linux/issues/370 [1]
Signed-off-by: Mariia Nikitash <nikitash.mariiaw@gmail.com>
---
 drivers/media/common/siano/smsir.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/media/common/siano/smsir.c b/drivers/media/common/siano/smsir.c
index 283770d583d5..636ff228108b 100644
--- a/drivers/media/common/siano/smsir.c
+++ b/drivers/media/common/siano/smsir.c
@@ -55,8 +55,8 @@ int sms_ir_init(struct smscore_device_t *coredev)
 	snprintf(coredev->ir.name, sizeof(coredev->ir.name),
 		 "SMS IR (%s)", sms_get_board(board_id)->name);
 
-	strscpy(coredev->ir.phys, coredev->devpath, sizeof(coredev->ir.phys));
-	strlcat(coredev->ir.phys, "/ir0", sizeof(coredev->ir.phys));
+	snprintf(coredev->ir.phys, sizeof(coredev->ir.phys),
+		 "%s/ir0", coredev->devpath);
 
 	dev->device_name = coredev->ir.name;
 	dev->input_phys = coredev->ir.phys;
-- 
2.43.0


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2026-11-04 19:02 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-04  9:02 [PATCH] media: siano: Replace strlcat() with snprintf() in sms_ir_init() Mariia Nikitash
2026-11-04 11:25 ` Alejandro Colomar
2026-11-04 19:01   ` Mariia Nikitash
2026-11-04 16:33 ` Shihuang Liu
2026-11-04 18:50 ` [PATCH v2] " Mariia Nikitash

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®