Skip to content

Commit

Permalink
[groups] Fix storing group data counter (#15795)
Browse files Browse the repository at this point in the history
Depending on the KVS implementation, the size variable
passed to the SyncSetKeyValue() might have been modified
by previous SyncGetKeyValue() calls.
  • Loading branch information
Damian-Nordic authored and pull[bot] committed Nov 10, 2023
1 parent 34b3fb1 commit 7561731
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/transport/GroupPeerMessageCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,7 @@ CHIP_ERROR GroupOutgoingCounters::Init(chip::PersistentStorageDelegate * storage
}

temp = mGroupControlCounter + GROUP_MSG_COUNTER_MIN_INCREMENT;
size = static_cast<uint16_t>(sizeof(temp));
ReturnErrorOnFailure(mStorage->SyncSetKeyValue(key.GroupControlCounter(), &temp, size));

temp = mGroupDataCounter + GROUP_MSG_COUNTER_MIN_INCREMENT;
Expand Down

0 comments on commit 7561731

Please sign in to comment.