-
Notifications
You must be signed in to change notification settings - Fork 2.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove CHIP buffer size check within shell and leave this it to lower layer #7523
Remove CHIP buffer size check within shell and leave this it to lower layer #7523
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, thank you! There's one remaining issue in SystemPacketBuffer and it's a little weird to be sending random
VerifyOrExit(!payloadBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); | ||
|
||
payloadBuf->SetDataLength(gPingArguments.GetEchoReqSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please memset the part of the buffer up to the new data length to 0 or otherwise initialize it. Otherwise we are possibly leaking data that was in previous messages. Might be OK here, but in general it's a really bad pattern and we should not have it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acked
VerifyOrExit(!payloadBuf.IsNull(), err = CHIP_ERROR_NO_MEMORY); | ||
|
||
payloadBuf->SetDataLength(gSendArguments.GetPayloadSize()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Again, we should not be sending uninitialized data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Acked
Size increase report for "nrfconnect-example-build" from 6f297c5
Full report output
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Much better, thank you!
… layer (project-chip#7523) * Remove CHIP buffer size check within shell and leave this check to transport layer * Address review comments
Problem
What is being fixed?
We should not take Payload size check within the shell application since it does not take default header size into account,
For example, I set the buffer size to 1279, which passed the payload size check within Shell, but still failed with CHIP Error 4004
Change overview
Testing
How was this tested? (at least one bullet point required)
Set the Payload size to 1281 which exceed the previous kMaxPayloadSize
Confirm the command send failed at lower layer due to "Message too long"