Skip to content

Commit 9482af3

Browse files
shripad621gittehampson
authored andcommitted
Fixed the crash due to packet buffers running out of space in CommandHandlerImpl. (project-chip#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>
1 parent 3f4e117 commit 9482af3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/CommandHandlerImpl.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,12 @@ class CommandHandlerImpl : public CommandHandler
294294
{
295295
return CHIP_NO_ERROR;
296296
}
297-
ReturnErrorOnFailure(RollbackResponse());
297+
// The error value of RollbackResponse is not important if it fails, we prioritize
298+
// conveying the error generated by addResponseFunction to the caller.
299+
if (RollbackResponse() != CHIP_NO_ERROR)
300+
{
301+
return err;
302+
}
298303
// If we failed to add a command due to lack of space in the
299304
// packet, we will make another attempt to add the response using
300305
// an additional InvokeResponseMessage.

0 commit comments

Comments
 (0)