Skip to contentSkip to conversation

sounds: firewire: isight: changed strcpy to strscpy

PATCH In review jack Livingood 3 participants 3 messages Feb 5, 2025 – Feb 10, 2025

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 sounds: firewire: isight: changed strcpy to strscpy

From: Jack Livingood <[email protected]>

changed strcpy to strscpy in order to prevent a possible linear overflow.

---
 sound/firewire/isight.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
sound/firewire/isight.c +3 -3
index 806f82c9ceee..e9617fc0a532 100644
@@ -637,13 +637,13 @@ static int isight_probe(struct fw_unit *unit,
 
 	card->private_free = isight_card_free;
 
-	strcpy(card->driver, "iSight");
-	strcpy(card->shortname, "Apple iSight");
+	strscpy(card->driver, "iSight");
+	strscpy(card->shortname, "Apple iSight");
 	snprintf(card->longname, sizeof(card->longname),
 		 "Apple iSight (GUID %08x%08x) at %s, S%d",
 		 fw_dev->config_rom[3], fw_dev->config_rom[4],
 		 dev_name(&unit->device), 100 << fw_dev->max_speed);
-	strcpy(card->mixername, "iSight");
+	strspy(card->mixername, "iSight");
 
 	err = isight_create_pcm(isight);
 	if (err < 0)
Signature · 1 line
2.48.1