From 2e63c495f59bb479f35a64d61fbb71d06c0dc9c1 Mon Sep 17 00:00:00 2001 From: Thorsten Blum Date: Tue, 23 Sep 2025 23:38:31 +0200 Subject: [PATCH] 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 Link: https://patch.msgid.link/20250923213831.1896823-2-thorsten.blum@linux.dev Signed-off-by: Felix Fietkau --- mt76_connac_mcu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mt76_connac_mcu.c b/mt76_connac_mcu.c index 9d5fcb33..fba7025f 100644 --- a/mt76_connac_mcu.c +++ b/mt76_connac_mcu.c @@ -1974,7 +1974,7 @@ int mt76_connac_mcu_chip_config(struct mt76_dev *dev) .resp_type = 0, }; - memcpy(req.data, "assert", 7); + strscpy(req.data, "assert"); return mt76_mcu_send_msg(dev, MCU_CE_CMD(CHIP_CONFIG), &req, sizeof(req), false);