Bound the contact name copy into the UI recent list

addToRecents() in the new and tiny companion UIs strcpy()s the contact
name into a 32-byte field. Names are terminated on receipt now, but use
a bounded copy here as well, like the other name copies in the UIs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Mark RoseandClaude Opus 5.5 committed 2026-11-27 00:23:50 -06:00
1 parent e86ed1373b
commit 3accaf358d
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -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();
}
+1 -1
View File
@@ -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();
}