Skip to content

Commit

Permalink
Return correct error code when sending large ping (project-chip#6244)
Browse files Browse the repository at this point in the history
  • Loading branch information
pan-apple authored and wahajsyed committed May 28, 2021
1 parent 695c803 commit d5526dc
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 d5526dc

Please sign in to comment.