-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Commissioning time sync: copy parameters to autocommissioner #29908
Conversation
PR #29908: Size comparison from 7287731 to d5e0ea5 Increases (1 build for linux)
Full report (19 builds for cc13x4_26x4, cc32xx, k32w, linux, mbed, nrfconnect, qpg)
|
PR #29908: Size comparison from 7287731 to 6fc80bc Increases above 0.2%:
Increases (15 builds for cc13x4_26x4, k32w, linux, qpg)
Full report (63 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, k32w, linux, mbed, nrfconnect, qpg, telink)
|
PR #29908: Size comparison from 7287731 to f414b09 Increases above 0.2%:
Increases (22 builds for bl702, cc13x4_26x4, cc32xx, k32w, linux, qpg)
Decreases (8 builds for bl702, bl702l, cc32xx)
Full report (63 builds for bl602, bl702, bl702l, cc13x4_26x4, cc32xx, efr32, esp32, k32w, linux, mbed, nrfconnect, qpg, telink)
|
if (mTimeZoneBuf[i].name.HasValue()) | ||
{ | ||
auto span = MutableCharSpan(mTimeZoneNames[i], kMaxTimeZoneNameLen); | ||
CopyCharSpanToMutableCharSpan(mTimeZoneBuf[i].name.Value(), span); |
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.
If this fails, won't this leave garbage data in mTimeZoneNames[i]
? And leave span
as garbage pointing to possibly un-initialized memory too?
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.
why would that ever fail? It's a statically allocated buffer that's been size checked.
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.
I don't think mTimeZoneBuf[i].name.Value()
has been size-checked...
…-chip#29908) * Commissioning time sync: copy parameters to autocommissioner * Restyled by clang-format * use a min function rather than being crazy --------- Co-authored-by: Restyled.io <[email protected]>
The auto commissioner is meant to take ownership of the supplied buffers from the caller. PR adds static buffers for time zone and DST. Unfortunately, neither is trivially destructible until we move from chip::Optional to std::optional. For now, they are static, we can move to dynamic allocation if required once we have support and can use proper memory management tools.