From c581163dcfb151f736784bae703d0e10c22e00a1 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Mon, 1 Apr 2019 13:06:24 +0300 Subject: [PATCH] Bluetooth: Fix not accepting string equal to CONFIG_BT_DEVICE_NAME_MAX In order to accept string of the same size entered in CONFIG_BT_DEVICE_NAME_MAX an extra byte must be allocated to guarantee it will always be NULL terminated. Fixes #15067 Signed-off-by: Luiz Augusto von Dentz --- subsys/bluetooth/host/hci_core.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subsys/bluetooth/host/hci_core.h b/subsys/bluetooth/host/hci_core.h index d97562ea813..4aa14c6e67a 100644 --- a/subsys/bluetooth/host/hci_core.h +++ b/subsys/bluetooth/host/hci_core.h @@ -172,7 +172,7 @@ struct bt_dev { /* Local Name */ #if defined(CONFIG_BT_DEVICE_NAME_DYNAMIC) - char name[CONFIG_BT_DEVICE_NAME_MAX]; + char name[CONFIG_BT_DEVICE_NAME_MAX + 1]; #endif };