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.

usb: musb: Use safer strscpy() instead of strcpy()

Use a safer function strscpy() instead of strcpy() for copying to
arrays.

Only idiomatic code replacement, and no functional changes.

Signed-off-by: Ai Chao <aichao@kylinos.cn>
Link: https://patch.msgid.link/20260310094434.3639602-3-aichao@kylinos.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Ai Chao and committed by
Greg Kroah-Hartman
786bf7ef c384f7ad

+1 -1
+1 -1
drivers/usb/musb/musb_core.c
··· 1600 1600 /* log core options (read using indexed model) */ 1601 1601 reg = musb_read_configdata(mbase); 1602 1602 1603 - strcpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8"); 1603 + strscpy(aInfo, (reg & MUSB_CONFIGDATA_UTMIDW) ? "UTMI-16" : "UTMI-8"); 1604 1604 if (reg & MUSB_CONFIGDATA_DYNFIFO) { 1605 1605 strcat(aInfo, ", dyn FIFOs"); 1606 1606 musb->dyn_fifo = true;