Skip to content

Commit

Permalink
Fixed the crash due to packet buffers running out of space in Command…
Browse files Browse the repository at this point in the history
…HandlerImpl. (#35279)

* Fixed the crash due to packet buffers running out of space in CommandHandlerImpl

* Update src/app/CommandHandlerImpl.h

Co-authored-by: Terence Hampson <thampson@google.com>

---------

Co-authored-by: Terence Hampson <thampson@google.com>
  • Loading branch information
shripad621git and tehampson authored Aug 29, 2024
1 parent 95ee157 commit 9c59899
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/app/CommandHandlerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,12 @@ class CommandHandlerImpl : public CommandHandler
{
return CHIP_NO_ERROR;
}
ReturnErrorOnFailure(RollbackResponse());
// The error value of RollbackResponse is not important if it fails, we prioritize
// conveying the error generated by addResponseFunction to the caller.
if (RollbackResponse() != CHIP_NO_ERROR)
{
return err;
}
// If we failed to add a command due to lack of space in the
// packet, we will make another attempt to add the response using
// an additional InvokeResponseMessage.
Expand Down

0 comments on commit 9c59899

Please sign in to comment.