From a5be64326e57636795d2cef5390832708097075a Mon Sep 17 00:00:00 2001 From: Vivien Nicolas Date: Mon, 19 Feb 2024 18:29:26 +0100 Subject: [PATCH] [DiagnosticLogs] When the size of the TransferFileDesignator is 0, the server should returns CONSTRAINT_ERROR (#32207) --- .../clusters/diagnostic-logs-server/diagnostic-logs-server.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp index 83beb46484bb71..7b1b036ee4857b 100644 --- a/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp +++ b/src/app/clusters/diagnostic-logs-server/diagnostic-logs-server.cpp @@ -132,6 +132,8 @@ void DiagnosticLogsServer::HandleLogRequestForBdx(CommandHandler * commandObj, c // INVALID_COMMAND. VerifyOrReturn(transferFileDesignator.HasValue(), commandObj->AddStatus(path, Status::InvalidCommand)); + VerifyOrReturn(transferFileDesignator.Value().size() > 0, commandObj->AddStatus(path, Status::ConstraintError)); + VerifyOrReturn(transferFileDesignator.Value().size() <= kMaxFileDesignatorLen, commandObj->AddStatus(path, Status::ConstraintError));