Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

wifi: mt76: connac: Replace memcpy + hard-coded size with strscpy

Replace memcpy() and the hard-coded string length with strscpy() to
safely copy the string and improve mt76_connac_mcu_chip_config().

No functional changes.

Signed-off-by: Thorsten Blum <thorsten.blum@linux.dev>
Link: https://patch.msgid.link/20250923213831.1896823-2-thorsten.blum@linux.dev
Signed-off-by: Felix Fietkau <nbd@nbd.name>

authored by

Thorsten Blum and committed by
Felix Fietkau
8c5b0630 08492206

+1 -1
+1 -1
drivers/net/wireless/mediatek/mt76/mt76_connac_mcu.c
··· 1974 1974 .resp_type = 0, 1975 1975 }; 1976 1976 1977 - memcpy(req.data, "assert", 7); 1977 + strscpy(req.data, "assert"); 1978 1978 1979 1979 return mt76_mcu_send_msg(dev, MCU_CE_CMD(CHIP_CONFIG), 1980 1980 &req, sizeof(req), false);