From a7746d3a3118e40bf3fc0bebc2dce77d9beb29aa Mon Sep 17 00:00:00 2001 From: Finlay Davidson Date: Thu, 16 Mar 2023 22:18:04 +0100 Subject: [PATCH] notification: Initialise message Prevents reading uninitialised memory if notification gets cut off due to being more than 100 chars. The last character is assumed to be \0, but it is actually uninitialised. --- src/components/ble/NotificationManager.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/components/ble/NotificationManager.h b/src/components/ble/NotificationManager.h index 09b5a561..f68a68af 100644 --- a/src/components/ble/NotificationManager.h +++ b/src/components/ble/NotificationManager.h @@ -30,7 +30,7 @@ namespace Pinetime { Id id = 0; bool valid = false; uint8_t size; - std::array message; + std::array message {}; Categories category = Categories::Unknown; const char* Message() const;