-
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
ThreadOperationalDataset: various bug fixes #34331
Conversation
ksperling-apple
commented
Jul 15, 2024
•
edited
Loading
edited
- Ensure TLVs read have the correct length
- Default construct as empty (mLength == 0)
- Change MakeRoom() size argument to size_t to avoid chance of truncation
- Check for null in SetNetworkName
- Use Encoding::BigEndian instead of hand-rolled math where possible
- Use ReturnErrorOnFailure / VerifyOrReturnError consistently
- Make tests independent from each other (non-static dataset member)
- Add more tests
- Ensure TLVs read have the correct length - Default construct as empty (mLength == 0) - Change MakeRoom() size argument to size_t to avoid chance of truncation - Check for null in SetNetworkName - Use Encoding::BigEndian instead of hand-rolled math - Use ReturnErrorOnFailure / VerifyOrReturnError consistently - Make tests independent from each other (non-static dataset member) - Add more tests
c4847c3
to
25316e8
Compare
PR #34331: Size comparison from 05e4c10 to 25316e8 Full report (52 builds for cc13x4_26x4, cyw30739, efr32, mbed, nxp, psoc6, qpg, stm32, telink, tizen)
|
PR #34331: Size comparison from 05e4c10 to c8d051f Full report (85 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, cyw30739, efr32, esp32, linux, mbed, nrfconnect, nxp, psoc6, qpg, stm32, telink, tizen)
|
VerifyOrReturnError(tlv->GetLength() == 3, CHIP_ERROR_INVALID_TLV_ELEMENT); | ||
// Note: The channel page (byte 0) is not returned | ||
const uint8_t * value = tlv->GetValue(); | ||
aChannel = static_cast<uint16_t>((value[1] << 8) | value[2]); |
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.
Could just BigEndian::Get16 starting at the right byte?
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.
ah yes, I'll include that change in my other PR.
* ThreadOperationalDataset: various bug fixes - Ensure TLVs read have the correct length - Default construct as empty (mLength == 0) - Change MakeRoom() size argument to size_t to avoid chance of truncation - Check for null in SetNetworkName - Use Encoding::BigEndian instead of hand-rolled math - Use ReturnErrorOnFailure / VerifyOrReturnError consistently - Make tests independent from each other (non-static dataset member) - Add more tests * Fix includes