Skip to content

Commit

Permalink
Return correct error code when sending large ping (#6244)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-apple authored and andreilitvin committed Apr 23, 2021
1 parent 68cba3a commit 2dc8c90
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion examples/shell/shell_common/cmd_ping.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ CHIP_ERROR SendEchoRequest(streamer_t * stream)
char * requestData = nullptr;

uint32_t size = gPingArguments.GetEchoReqSize();
VerifyOrExit(size <= kMaxPayloadSize, err = CHIP_ERROR_INVALID_MESSAGE_LENGTH);
VerifyOrExit(size <= kMaxPayloadSize, err = CHIP_ERROR_MESSAGE_TOO_LONG);

requestData = static_cast<char *>(chip::Platform::MemoryAlloc(size));
VerifyOrExit(requestData != nullptr, err = CHIP_ERROR_NO_MEMORY);
Expand Down

0 comments on commit 2dc8c90

Please sign in to comment.