Skip to content

Commit 7ddba36

Browse files
lazarkovrestyled-commits
andauthoredAug 26, 2024··
TV App - Add validation for invalid product and vendor id. (project-chip#35157)
* Add validation for pid&vid * Restyled by clang-format --------- Co-authored-by: Restyled.io <commits@restyled.io>
1 parent acba7f8 commit 7ddba36

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed
 

‎src/controller/CommissionerDiscoveryController.cpp

+8-1
Original file line numberDiff line numberDiff line change
@@ -155,6 +155,13 @@ void CommissionerDiscoveryController::OnUserDirectedCommissioningRequest(UDCClie
155155
return;
156156
}
157157

158+
if (state.GetProductId() == 0 && state.GetVendorId() == 0)
159+
{
160+
// this is an invalid request and should be ignored
161+
ChipLogDetail(Controller, "Ignoring the request as it's invalid. product and vendor id cannot be 0");
162+
return;
163+
}
164+
158165
mReady = false;
159166
Platform::CopyString(mCurrentInstance, state.GetInstanceName());
160167
mPendingConsent = true;
@@ -163,7 +170,7 @@ void CommissionerDiscoveryController::OnUserDirectedCommissioningRequest(UDCClie
163170
sizeof(rotatingIdString));
164171
if (err != CHIP_NO_ERROR)
165172
{
166-
ChipLogError(AppServer, "On UDC: could not convert rotating id to hex");
173+
ChipLogError(Controller, "On UDC: could not convert rotating id to hex");
167174
rotatingIdString[0] = '\0';
168175
}
169176
else

0 commit comments

Comments
 (0)
Please sign in to comment.