Skip to content

Commit

Permalink
[groups] Fix storing group data counter
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 committed Mar 3, 2022
1 parent 8895bdb commit 28eab57
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 28eab57

Please sign in to comment.