Skip to content

Commit 565ed00

Browse files
committed
ImmediateAlertService: fix possible bug
1 parent eeb0d23 commit 565ed00

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/components/ble/ImmediateAlertService.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ int ImmediateAlertService::OnAlertLevelChanged(uint16_t attributeHandle, ble_gat
6363
auto* alertString = ToString(alertLevel);
6464

6565
NotificationManager::Notification notif;
66-
std::memcpy(notif.message.data(), alertString, strlen(alertString));
66+
std::memcpy(notif.message.data(), alertString, strlen(alertString) + 1);
67+
notif.size = strlen(alertString) + 1;
6768
notif.category = Pinetime::Controllers::NotificationManager::Categories::SimpleAlert;
6869
notificationManager.Push(std::move(notif));
6970

0 commit comments

Comments
 (0)