Skip to content

Commit a7746d3

Browse files
committed
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.
1 parent 11ade64 commit a7746d3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/components/ble/NotificationManager.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ namespace Pinetime {
3030
Id id = 0;
3131
bool valid = false;
3232
uint8_t size;
33-
std::array<char, MessageSize + 1> message;
33+
std::array<char, MessageSize + 1> message {};
3434
Categories category = Categories::Unknown;
3535

3636
const char* Message() const;

0 commit comments

Comments
 (0)