Skip to content

Commit

Permalink
[DiagnosticLogs] When the size of the TransferFileDesignator is 0, th…
Browse files Browse the repository at this point in the history
…e server should returns CONSTRAINT_ERROR (project-chip#32207)
  • Loading branch information
vivien-apple authored Feb 19, 2024
1 parent d2ed79c commit a5be643
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit a5be643

Please sign in to comment.