Skip to content

Commit 38ede42

Browse files
[v1.3-branch] : Fixed the crash due to packet buffers running out of space in CommandHandlerImpl (#35308)
1 parent a5d5d13 commit 38ede42

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/app/CommandHandler.h

+6-1
Original file line numberDiff line numberDiff line change
@@ -327,7 +327,12 @@ class CommandHandler
327327
{
328328
return CHIP_NO_ERROR;
329329
}
330-
ReturnErrorOnFailure(RollbackResponse());
330+
// The error value of RollbackResponse is not important if it fails, we prioritize
331+
// conveying the error generated by addResponseFunction to the caller.
332+
if (RollbackResponse() != CHIP_NO_ERROR)
333+
{
334+
return err;
335+
}
331336
// If we failed to add a command due to lack of space in the
332337
// packet, we will make another attempt to add the response using
333338
// an additional InvokeResponseMessage.

0 commit comments

Comments
 (0)