Commit 517dd4db authored by Milo Yip's avatar Milo Yip

Fix failing to resolve $ref in allOf causes crash in SchemaValidator::StartObject()

parent 9b6af555
......@@ -1366,6 +1366,9 @@ public:
new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(refEntry->source, const_cast<SchemaType*>(s), false, allocator_);
}
}
else if (refEntry->schema)
*refEntry->schema = SchemaType::GetTypeless();
refEntry->~SchemaRefEntry();
}
......
......@@ -1308,6 +1308,14 @@ TEST(SchemaValidator, Issue608) {
INVALIDATE(s, "{\"a\" : null, \"a\" : null}", "", "required", "");
}
// Fail to resolve $ref in allOf causes crash in SchemaValidator::StartObject()
TEST(SchemaValidator, Issue728_AllOfRef) {
Document sd;
sd.Parse("{\"allOf\": [{\"$ref\": \"#/abc\"}]}");
SchemaDocument s(sd);
VALIDATE(s, "{\"key1\": \"abc\", \"key2\": \"def\"}", true);
}
#ifdef __clang__
RAPIDJSON_DIAG_POP
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment