Skip to content
This repository was archived by the owner on Dec 20, 2023. It is now read-only.

Commit 1d46cb9

Browse files
authored
Merge pull request #483 from robszewczyk/bug/misc-fixes
Bug/misc fixes
2 parents 7627fe1 + b84c9e8 commit 1d46cb9

File tree

4 files changed

+8
-6
lines changed

4 files changed

+8
-6
lines changed

src/lib/profiles/data-management/Current/GenericTraitCatalogImpl.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
* limitations under the License.
1717
*/
1818

19+
#if WEAVE_CONFIG_DATA_MANAGEMENT_CLIENT_EXPERIMENTAL
1920
#include <map>
2021
#include <limits>
2122
#include <Weave/Profiles/data-management/Current/WdmManagedNamespace.h>
@@ -32,3 +33,4 @@ template class GenericTraitCatalogImpl<TraitDataSource>;
3233
}; // namespace Profiles
3334
}; // namespace Weave
3435
}; // namespace nl
36+
#endif

src/lib/profiles/data-management/Current/SubscriptionEngine.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1879,7 +1879,7 @@ WEAVE_ERROR SubscriptionEngine::ProcessUpdateRequestDataElement(Weave::TLV::TLVR
18791879
if (err == WEAVE_ERROR_TLV_TAG_NOT_FOUND)
18801880
{
18811881
WeaveLogDetail(DataManagement, "Ignoring un-mappable path!");
1882-
err = WEAVE_NO_ERROR;
1882+
// no need to reset the value of err, it is set unconditionally below
18831883
}
18841884
#endif
18851885

src/lib/profiles/data-management/Current/TraitData.cpp

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -91,16 +91,15 @@ WEAVE_ERROR UpdateDictionaryDirtyPathCut::CutPath(PropertyPathHandle aPathhandle
9191
WEAVE_ERROR TraitSchemaEngine::ParseTagString(const char * apTagString, char ** apEndptr, uint8_t & aParseRes) const
9292
{
9393
WEAVE_ERROR err = WEAVE_NO_ERROR;
94-
94+
unsigned long int tag;
9595
VerifyOrExit(apTagString != NULL, err = WEAVE_ERROR_INVALID_ARGUMENT);
9696
VerifyOrExit(*apTagString == '/', err = WEAVE_ERROR_INVALID_ARGUMENT);
9797

9898
apTagString++;
99-
100-
aParseRes = strtoul(apTagString, apEndptr, 0);
99+
tag = strtoul(apTagString, apEndptr, 0);
101100
VerifyOrExit(!(*apEndptr == apTagString || (**apEndptr != '\0' && **apEndptr != '/')), err = WEAVE_ERROR_INVALID_ARGUMENT);
102-
VerifyOrExit(aParseRes < kContextTagMaxNum, err = WEAVE_ERROR_INVALID_TLV_TAG);
103-
101+
VerifyOrExit(tag < kContextTagMaxNum, err = WEAVE_ERROR_INVALID_TLV_TAG);
102+
aParseRes = tag;
104103
exit:
105104
return err;
106105
}

src/lib/profiles/security/WeaveCertProvisioning.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,7 @@ WEAVE_ERROR WeaveCertProvEngine::ProcessGetCertificateResponse(PacketBuffer * ms
336336
relatedCertsLen = writer.GetLengthWritten() - certLen;
337337

338338
err = reader.Next();
339+
VerifyOrExit(err == WEAVE_END_OF_TLV, err = WEAVE_ERROR_UNEXPECTED_TLV_ELEMENT);
339340
}
340341

341342
err = reader.VerifyEndOfContainer();

0 commit comments

Comments
 (0)