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
  • Loading branch information
shripad621git committed Aug 29, 2024
1 parent 9bbf5b9 commit ea62667
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/app/CommandHandlerImpl.h
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,13 @@ class CommandHandlerImpl : public CommandHandler
{
return CHIP_NO_ERROR;
}
ReturnErrorOnFailure(RollbackResponse());
// Here the err from previous step is returned intentionally if RollBackResonse fails due to
// running out of packet buffers i.e due to CHIP_ERROR_NO_MEMORY in AllocateBuffer() and
// fails to set the mRollBackBackupValid.
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 ea62667

Please sign in to comment.