-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[HVAC] Added Enhanced Scheduling feature for TRV app #38839
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
base: master
Are you sure you want to change the base?
Conversation
ad84990
to
e702a20
Compare
e702a20
to
0560f34
Compare
PR #38839: Size comparison from 8167c5f to 0560f34 Increases above 0.2%:
Full report (3 builds for cc32xx, stm32)
|
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.
Manual
is insufficient detail about what was tested.
please provide detailed description: what did you test, why, what were the observed results, justify why automated testing is impossible in this case.
Cluster functionality seems like it should be automatable. Please try to automate this.
if (!newScheduleHandle.IsNull()) | ||
{ | ||
size_t newScheduleHandleSize = newScheduleHandle.Value().size(); | ||
if (newScheduleHandleSize > kScheduleHandleSize) |
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 (newScheduleHandleSize > kScheduleHandleSize) | |
if (newScheduleHandleSize > sizeof(scheduleHandleData)) |
and same in the logging would be clearer.
if (newName.HasValue()) | ||
{ | ||
size_t newNameSize = newName.Value().size(); | ||
if (newNameSize > kScheduleNameSize) |
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.
Same as for the handle.
if (newPresetHandle.HasValue()) | ||
{ | ||
size_t newPresetHandleSize = newPresetHandle.Value().size(); | ||
if (newPresetHandleSize > kSchedulePresetHandleSize) |
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.
Same as above.
|
||
for (size_t i = 0; i < scheduleTransitionSize; i++) | ||
{ | ||
scheduleTransitionData[i] = newTransitions[i]; |
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.
This does not seem to be keeping a copy of the PresetHandle in the ScheduleTransitionStruct, so this looks like a likely use-after-free.
builtIn = newBuiltIn; | ||
} | ||
|
||
Structs::ScheduleTransitionStruct::Type * ScheduleStructWithOwnedMembers::GetTransitionData() const |
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.
How would an API consumer use this?
And in fact, this seems to be unused....
while (iter.Next()) | ||
{ | ||
ScheduleStruct::DecodableType decodeSchedule = iter.GetValue(); | ||
ScheduleTransitionStruct::Type transitions[5]; |
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.
Where is this 5 coming from?
|
||
while (iter2.Next()) | ||
{ | ||
transitions[i] = iter2.GetValue(); |
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.
This is a security bug.
{ | ||
transitions[i] = iter2.GetValue(); | ||
i++; | ||
} |
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.
Where's the iterator status check?
|
||
transitions[i] = iter.GetValue(); | ||
i++; | ||
} |
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.
Missing validity check.
schedule.scheduleHandle = decodeSchedule.scheduleHandle; | ||
schedule.name = decodeSchedule.name; | ||
schedule.presetHandle = decodeSchedule.presetHandle; | ||
schedule.transitions = DataModel::List<const Structs::ScheduleTransitionStruct::Type>(transitions.get(), i); |
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.
So why did we heap-allocate the transitions? Couldn't we have just put them on the stack?
Testing