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 <luiz.von.dentz@intel.com>
This commit is contained in:
Luiz Augusto von Dentz 2019-04-01 13:06:24 +03:00 committed by Johan Hedberg
parent 77546a0e5a
commit c581163dcf

View File

@ -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
};