Skip to content

Commit

Permalink
Replace memmove of PASESessionSerializable (#5029)
Browse files Browse the repository at this point in the history
#### Problem

From https://github.com/project-chip/connectedhomeip/pull/3630/files#r520114117

#### Summary of Changes

Use (C++ default) assignment.

fixes #3761 - Add an operator= to SecurePairingSessionSerializable
  • Loading branch information
kpschoedel authored and pull[bot] committed Mar 4, 2021
1 parent 5e3a861 commit 730d200
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/controller/CHIPDevice.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ CHIP_ERROR Device::Serialize(SerializedDevice & output)

CHIP_ZERO_AT(serializable);

memmove(&serializable.mOpsCreds, &mPairing, sizeof(mPairing));
serializable.mOpsCreds = mPairing;
serializable.mDeviceId = Encoding::LittleEndian::HostSwap64(mDeviceId);
serializable.mDevicePort = Encoding::LittleEndian::HostSwap16(mDevicePort);
serializable.mAdminId = Encoding::LittleEndian::HostSwap16(mAdminId);
Expand Down Expand Up @@ -196,7 +196,7 @@ CHIP_ERROR Device::Deserialize(const SerializedDevice & input)
IPAddress::FromString(Uint8::to_const_char(serializable.mDeviceAddr), sizeof(serializable.mDeviceAddr) - 1, mDeviceAddr),
error = CHIP_ERROR_INVALID_ADDRESS);

memmove(&mPairing, &serializable.mOpsCreds, sizeof(mPairing));
mPairing = serializable.mOpsCreds;
mDeviceId = Encoding::LittleEndian::HostSwap64(serializable.mDeviceId);
mDevicePort = Encoding::LittleEndian::HostSwap16(serializable.mDevicePort);
mAdminId = Encoding::LittleEndian::HostSwap16(serializable.mAdminId);
Expand Down

0 comments on commit 730d200

Please sign in to comment.