Skip to content

Commit

Permalink
Add check for index when reorder network
Browse files Browse the repository at this point in the history
  • Loading branch information
wqx6 committed Jan 10, 2022
1 parent d318413 commit a3324c2
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/platform/ESP32/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -116,6 +116,8 @@ Status ESPWiFiDriver::RemoveNetwork(ByteSpan networkId)

Status ESPWiFiDriver::ReorderNetwork(ByteSpan networkId, uint8_t index)
{
// Only one network is supported now
VerifyOrReturnError(index == 0, Status::kOutOfRange);
VerifyOrReturnError(NetworkMatch(mStagingNetwork, networkId), Status::kNetworkIDNotFound);
return Status::kSuccess;
}
Expand Down

0 comments on commit a3324c2

Please sign in to comment.