From 62874d32bd6e6da74b6deba4d6305beaabd95fe9 Mon Sep 17 00:00:00 2001 From: Davis Mosenkovs Date: Sat, 21 Oct 2023 00:48:59 +0300 Subject: [PATCH] ImmediateAlertService: fix possible bug --- src/components/ble/ImmediateAlertService.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/components/ble/ImmediateAlertService.cpp b/src/components/ble/ImmediateAlertService.cpp index b9de615aa0..e25e018f92 100644 --- a/src/components/ble/ImmediateAlertService.cpp +++ b/src/components/ble/ImmediateAlertService.cpp @@ -63,7 +63,8 @@ int ImmediateAlertService::OnAlertLevelChanged(uint16_t attributeHandle, ble_gat auto* alertString = ToString(alertLevel); NotificationManager::Notification notif; - std::memcpy(notif.message.data(), alertString, strlen(alertString)); + std::memcpy(notif.message.data(), alertString, strlen(alertString) + 1); + notif.size = strlen(alertString) + 1; notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert; notificationManager.Push(std::move(notif));