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 Jul 6, 2023
1 parent 7f91915 commit 3285588
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 3285588

Please sign in to comment.