aboutsummaryrefslogtreecommitdiff
path: root/src/cppbor_parse.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/cppbor_parse.cpp')
-rw-r--r--src/cppbor_parse.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cppbor_parse.cpp b/src/cppbor_parse.cpp
index 5cf76b2..fcf0dac 100644
--- a/src/cppbor_parse.cpp
+++ b/src/cppbor_parse.cpp
@@ -202,8 +202,13 @@ std::tuple<const uint8_t*, ParseClient*> parseRecursively(const uint8_t* begin,
bool success = true;
uint64_t addlData;
- if (tagInt < ONE_BYTE_LENGTH || tagInt > EIGHT_BYTE_LENGTH) {
+ if (tagInt < ONE_BYTE_LENGTH) {
addlData = tagInt;
+ } else if (tagInt > EIGHT_BYTE_LENGTH) {
+ parseClient->error(
+ begin,
+ "Reserved additional information value or unsupported indefinite length item.");
+ return {begin, nullptr};
} else {
switch (tagInt) {
case ONE_BYTE_LENGTH: