Commit 97fb9bc8 authored by Milo Yip's avatar Milo Yip Committed by GitHub

Merge pull request #770 from miloyip/issue728_threadsafe

Fixed another crash bug in #728
parents 3b1a0374 517dd4db
......@@ -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