OSDN Git Service

Bluetooth: btmrvl_sdio: Remove all strcpy() uses
authorLen Baker <len.baker@gmx.com>
Sat, 24 Jul 2021 12:21:52 +0000 (14:21 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Thu, 29 Jul 2021 11:46:13 +0000 (13:46 +0200)
commit785077fa2d6791d036b4227924276534ae0f192f
tree4cbd84d1f281f8bbc26e6101e8f77513577b20ec
parent92fe24a7db751b80925214ede43f8d2be792ea7b
Bluetooth: btmrvl_sdio: Remove all strcpy() uses

strcpy() performs no bounds checking on the destination buffer. This
could result in linear overflows beyond the end of the buffer, leading
to all kinds of misbehaviors. The safe replacement is strscpy() but in
this case it is better to use the scnprintf to simplify the arithmetic.

This is a previous step in the path to remove the strcpy() function
entirely from the kernel.

Signed-off-by: Len Baker <len.baker@gmx.com>
Signed-off-by: Marcel Holtmann <marcel@holtmann.org>
drivers/bluetooth/btmrvl_sdio.c