Skip to content

Commit ea62667

Browse files
committed
Fixed the crash due to packet buffers running out of space in CommandHandlerImpl
1 parent 9bbf5b9 commit ea62667

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/app/CommandHandlerImpl.h

+7-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,13 @@ class CommandHandlerImpl : public CommandHandler
294294
{
295295
return CHIP_NO_ERROR;
296296
}
297-
ReturnErrorOnFailure(RollbackResponse());
297+
// Here the err from previous step is returned intentionally if RollBackResonse fails due to
298+
// running out of packet buffers i.e due to CHIP_ERROR_NO_MEMORY in AllocateBuffer() and
299+
// fails to set the mRollBackBackupValid.
300+
if (RollbackResponse() != CHIP_NO_ERROR)
301+
{
302+
return err;
303+
}
298304
// If we failed to add a command due to lack of space in the
299305
// packet, we will make another attempt to add the response using
300306
// an additional InvokeResponseMessage.

0 commit comments

Comments
 (0)