This repository was archived by the owner on Dec 20, 2023. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +14
-3
lines changed
src/lib/profiles/data-management/Current Expand file tree Collapse file tree 1 file changed +14
-3
lines changed Original file line number Diff line number Diff line change 11/*
22 *
3+ * Copyright (c) 2018 Google LLC.
34 * Copyright (c) 2016-2017 Nest Labs, Inc.
45 * All rights reserved.
56 *
4748
4849#include < stdio.h>
4950
51+ using namespace ::nl;
52+ using namespace ::nl::Weave;
53+ using namespace ::nl::Weave::TLV;
54+
5055#ifndef MIN
5156#define MIN (x, y ) (((x) < (y)) ? (x) : (y))
5257#endif
@@ -2741,13 +2746,19 @@ WEAVE_ERROR StatusList::Parser::CheckSchemaValidity(void) const
27412746
27422747 while (WEAVE_NO_ERROR == (err = reader.Next ()))
27432748 {
2749+ TLVType type;
2750+ uint64_t tag;
2751+
27442752 // TODO: The spec says the StatusList should be an array of arrays, but in
27452753 // the current implementation it's an array of structures. The array of
27462754 // arrays is less intuitive but more space efficient.
2747- VerifyOrExit (nl::Weave::TLV::AnonymousTag == reader.GetTag (), err = WEAVE_ERROR_INVALID_TLV_TAG);
27482755
2749- VerifyOrExit ((nl::Weave::TLV::kTLVType_Structure == reader.GetType () ||
2750- nl::Weave::TLV::kTLVType_Array ), err = WEAVE_ERROR_WRONG_TLV_TYPE);
2756+ tag = reader.GetTag ();
2757+ VerifyOrExit (nl::Weave::TLV::AnonymousTag == tag, err = WEAVE_ERROR_INVALID_TLV_TAG);
2758+
2759+ type = reader.GetType ();
2760+ VerifyOrExit ((nl::Weave::TLV::kTLVType_Structure == type ||
2761+ nl::Weave::TLV::kTLVType_Array == type), err = WEAVE_ERROR_WRONG_TLV_TYPE);
27512762
27522763 {
27532764 StatusElement::Parser status;
You can’t perform that action at this time.
0 commit comments