Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TV App - Add validation for invalid product and vendor id. #35157

Merged
merged 7 commits into from
Aug 26, 2024
9 changes: 8 additions & 1 deletion src/controller/CommissionerDiscoveryController.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,13 @@ void CommissionerDiscoveryController::OnUserDirectedCommissioningRequest(UDCClie
return;
}

if (state.GetProductId() == 0 && state.GetVendorId() == 0)
{
// this is an invalid request and should be ignored
ChipLogDetail(Controller, "Ignoring the request as it's invalid. product and vendor id cannot be 0");
return;
}

mReady = false;
Platform::CopyString(mCurrentInstance, state.GetInstanceName());
mPendingConsent = true;
Expand All @@ -163,7 +170,7 @@ void CommissionerDiscoveryController::OnUserDirectedCommissioningRequest(UDCClie
sizeof(rotatingIdString));
if (err != CHIP_NO_ERROR)
{
ChipLogError(AppServer, "On UDC: could not convert rotating id to hex");
ChipLogError(Controller, "On UDC: could not convert rotating id to hex");
rotatingIdString[0] = '\0';
}
else
Expand Down
Loading