diff --git a/src/helpers/ui/companion-new/UITask.cpp b/src/helpers/ui/companion-new/UITask.cpp index 2427347a..532b0a2f 100644 --- a/src/helpers/ui/companion-new/UITask.cpp +++ b/src/helpers/ui/companion-new/UITask.cpp @@ -264,7 +264,7 @@ public: auto p = &recent[recent_next_idx]; recent_next_idx = (recent_next_idx + 1) % UI_RECENT_LIST_SIZE; - strcpy(p->name, contact.name); + StrHelper::strncpy(p->name, contact.name, sizeof(p->name)); p->recv_timestamp = _rtc->getCurrentTime(); } diff --git a/src/helpers/ui/companion-tiny/UITask.cpp b/src/helpers/ui/companion-tiny/UITask.cpp index a26c50e0..612941a3 100644 --- a/src/helpers/ui/companion-tiny/UITask.cpp +++ b/src/helpers/ui/companion-tiny/UITask.cpp @@ -159,7 +159,7 @@ public: auto p = &recent[recent_next_idx]; recent_next_idx = (recent_next_idx + 1) % UI_RECENT_LIST_SIZE; - strcpy(p->name, contact.name); + StrHelper::strncpy(p->name, contact.name, sizeof(p->name)); p->recv_timestamp = _rtc->getCurrentTime(); }