Skip to content

Commit 9c0e2c1

Browse files
committed
swap out CopyString with memcpy using src buffer size
1 parent 7bd0669 commit 9c0e2c1

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

examples/lock-app/silabs/include/LockManager.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ using namespace EFR32DoorLock::ResourceRanges;
116116

117117
struct LockUserInfo
118118
{
119-
char userName[DOOR_LOCK_USER_NAME_BUFFER_SIZE];
119+
char userName[DOOR_LOCK_MAX_USER_NAME_SIZE];
120120
size_t userNameSize;
121121
uint32_t userUniqueId;
122122
UserStatusEnum userStatus;

examples/lock-app/silabs/src/LockManager.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -445,7 +445,7 @@ bool LockManager::SetUser(chip::EndpointId endpointId, uint16_t userIndex, chip:
445445
return false;
446446
}
447447

448-
chip::Platform::CopyString(userInStorage.userName, userName.data());
448+
memcpy(userInStorage.userName, userName.data(), userName.size());
449449
userInStorage.userNameSize = userName.size();
450450
userInStorage.userUniqueId = uniqueId;
451451
userInStorage.userStatus = userStatus;

0 commit comments

Comments
 (0)