Bluetooth: hci_core: Fix possible buffer overflow
authorLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 28 Feb 2024 15:49:26 +0000 (10:49 -0500)
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>
Wed, 6 Mar 2024 22:26:22 +0000 (17:26 -0500)
commit81137162bfaa7278785b24c1fd2e9e74f082e8e4
tree944a0875e6f12bf11393874812043f7fc96cf555
parentde4e88ec58c4202efd1f02eebb4939bbf6945358
Bluetooth: hci_core: Fix possible buffer overflow

struct hci_dev_info has a fixed size name[8] field so in the event that
hdev->name is bigger than that strcpy would attempt to write past its
size, so this fixes this problem by switching to use strscpy.

Fixes: dcda165706b9 ("Bluetooth: hci_core: Fix build warnings")
Signed-off-by: Luiz Augusto von Dentz <luiz.von.dentz@intel.com>
net/bluetooth/hci_core.c