From 0c9d73f19c9b62c125240792d8d2c6883a187cab Mon Sep 17 00:00:00 2001 From: Marcin Kajor Date: Tue, 7 Nov 2023 12:22:18 +0100 Subject: [PATCH] [door-lock] Fix the crash when providing null-ed user index to the HandleLocalLockOperationError method We cannot assume that the valid user index is provided in case of the invalid credential. In fact, the spec in 5.2.5.4.4 says that UserIndex SHALL be null if there is no user id that can be determined for the given operation source. Signed-off-by: Marcin Kajor --- src/app/clusters/door-lock-server/door-lock-server.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/app/clusters/door-lock-server/door-lock-server.cpp b/src/app/clusters/door-lock-server/door-lock-server.cpp index 3912b022f90065..492eff62a4ddae 100644 --- a/src/app/clusters/door-lock-server/door-lock-server.cpp +++ b/src/app/clusters/door-lock-server/door-lock-server.cpp @@ -211,7 +211,7 @@ void DoorLockServer::HandleLocalLockOperationError(chip::EndpointId endpointId, HandleWrongCodeEntry(endpointId); - ChipLogProgress(Zcl, "Handling a local Lock Operation Error: [endpoint=%d, user=%d]", endpointId, userId.Value()); + ChipLogProgress(Zcl, "Handling a local Lock Operation Error: [endpoint=%d]", endpointId); } bool DoorLockServer::HandleWrongCodeEntry(chip::EndpointId endpointId)