Skip to content
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

[OTA Server] change "location" parameter code once CHAR_STRING is supported #7112

Closed
holbrookt opened this issue May 25, 2021 · 0 comments · Fixed by #10786
Closed

[OTA Server] change "location" parameter code once CHAR_STRING is supported #7112

holbrookt opened this issue May 25, 2021 · 0 comments · Fixed by #10786

Comments

@holbrookt
Copy link
Contributor

Problem

emberAfOtaSoftwareUpdateServerClusterQueryImageCallback() contains some bandaid code to get the length of the location parameter, since it is being generated as uint8_t* instead of Span:

    const uint8_t locationLen = emberAfStringLength(location);
    if ((locationLen != kLocationParamLength) || (metadataForServer.size() > kMaxMetadataLen))

(This was added in #6476)

This may need to happen in the same PR as when CHAR_STRING is supported, since it may not compile afterwards.

Proposed Solution

After CHAR_STRING is supported, location should be a Span object, and the size() method can be used instead.

bzbarsky-apple added a commit to bzbarsky-apple/connectedhomeip that referenced this issue Oct 21, 2021
Fixes project-chip#7112

Also fixes missing return if the metadata size was wrong, which would
lead to us trying to process the command anyway.
woody-apple pushed a commit to bzbarsky-apple/connectedhomeip that referenced this issue Oct 21, 2021
Fixes project-chip#7112

Also fixes missing return if the metadata size was wrong, which would
lead to us trying to process the command anyway.
bzbarsky-apple added a commit that referenced this issue Oct 22, 2021
* Enforce spec limit on the location in OTA QueryImage.

Fixes #7112

Also fixes missing return if the metadata size was wrong, which would
lead to us trying to process the command anyway.

* Update src/app/clusters/ota-provider/ota-provider.cpp

Co-authored-by: Trevor Holbrook <[email protected]>

Co-authored-by: Trevor Holbrook <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
1 participant