Skip to content

Commit

Permalink
Stop assuming spans are null-terminated in WiFi driver impls. (#25318)
Browse files Browse the repository at this point in the history
Fixes #24271
  • Loading branch information
bzbarsky-apple authored and pull[bot] committed Dec 18, 2023
1 parent 43931d8 commit 2610156
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/platform/Linux/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void LinuxWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callb

VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound);

ChipLogProgress(NetworkProvisioning, "LinuxNetworkCommissioningDelegate: SSID: %s",
ChipLogProgress(NetworkProvisioning, "LinuxWiFiDriver: SSID: %.*s", static_cast<int>(networkId.size()),
StringOrNullMarker((char *) networkId.data()));

err = ConnectivityMgrImpl().ConnectWiFiNetworkAsync(ByteSpan(mStagingNetwork.ssid, mStagingNetwork.ssidLen),
Expand Down
2 changes: 1 addition & 1 deletion src/platform/nxp/mw320/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ void Mw320WiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callb

VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound);

ChipLogProgress(NetworkProvisioning, "LinuxNetworkCommissioningDelegate: SSID: %s", networkId.data());
ChipLogProgress(NetworkProvisioning, "Mw320WiFiDriver: SSID: %.*s", static_cast<int>(networkId.size()), networkId.data());

err = ConnectivityMgrImpl().ConnectWiFiNetworkAsync(ByteSpan(mStagingNetwork.ssid, mStagingNetwork.ssidLen),
ByteSpan(mStagingNetwork.credentials, mStagingNetwork.credentialsLen),
Expand Down
2 changes: 1 addition & 1 deletion src/platform/webos/NetworkCommissioningWiFiDriver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ void LinuxWiFiDriver::ConnectNetwork(ByteSpan networkId, ConnectCallback * callb

VerifyOrExit(NetworkMatch(mStagingNetwork, networkId), networkingStatus = Status::kNetworkIDNotFound);

ChipLogProgress(NetworkProvisioning, "LinuxNetworkCommissioningDelegate: SSID: %s", networkId.data());
ChipLogProgress(NetworkProvisioning, "LinuxWiFiDriver: SSID: %.*s", static_cast<int>(networkId.size()), networkId.data());

err = ConnectivityMgrImpl().ConnectWiFiNetworkAsync(ByteSpan(mStagingNetwork.ssid, mStagingNetwork.ssidLen),
ByteSpan(mStagingNetwork.credentials, mStagingNetwork.credentialsLen),
Expand Down

0 comments on commit 2610156

Please sign in to comment.