8000 Skip ext 32 · enginux/ArduinoJson@797088b · GitHub
[go: up one dir, main page]

Skip to content

Commit 797088b

Browse files
committed
Skip ext 32
1 parent c3353eb commit 797088b

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

extras/tests/MsgPackDeserializer/filter.cpp

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -410,6 +410,18 @@ TEST_CASE("deserializeMsgPack() filter") {
410410
CHECK(doc.as<std::string>() == "{\"include\":42}");
411411
CHECK(doc.memoryUsage() == JSON_OBJECT_SIZE(1) + 8);
412412
}
413+
414+
SECTION("skip ext 32") {
415+
error = deserializeMsgPack(doc,
416+
"\x82\xA6ignore"
417+
"\xc9\x00\x00\x00\x02\x00\x01\x02"
418+
"\xA7include\x2A",
419+
filterOpt);
420+
421+
CHECK(error == DeserializationError::Ok);
422+
CHECK(doc.as<std::string>() == "{\"include\":42}");
423+
CHECK(doc.memoryUsage() == JSON_OBJECT_SIZE(1) + 8);
424+
}
413425
}
414426

415427
SECTION("filter = true") {

src/ArduinoJson/MsgPack/MsgPackDeserializer.hpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,9 @@ class MsgPackDeserializer {
215215
case 0xc8: // ext 16
216216
return skipExt<uint16_t>();
217217

218+
case 0xc9: // ext 32
219+
return skipExt<uint32_t>();
220+
218221
case 0xdc: // array 16
219222
return skipArray<uint16_t>(nestingLimit);
220223

0 commit comments

Comments
 (0)
0