Merge pull request #770 from miloyip/issue728_threadsafe
Fixed another crash bug in #728
This commit is contained in:
commit
97fb9bc85b
@ -1366,6 +1366,9 @@ public:
|
|||||||
new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(refEntry->source, const_cast<SchemaType*>(s), false, allocator_);
|
new (schemaMap_.template Push<SchemaEntry>()) SchemaEntry(refEntry->source, const_cast<SchemaType*>(s), false, allocator_);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else if (refEntry->schema)
|
||||||
|
*refEntry->schema = SchemaType::GetTypeless();
|
||||||
|
|
||||||
refEntry->~SchemaRefEntry();
|
refEntry->~SchemaRefEntry();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1308,6 +1308,14 @@ TEST(SchemaValidator, Issue608) {
|
|||||||
INVALIDATE(s, "{\"a\" : null, \"a\" : null}", "", "required", "");
|
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__
|
#ifdef __clang__
|
||||||
RAPIDJSON_DIAG_POP
|
RAPIDJSON_DIAG_POP
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
x
Reference in New Issue
Block a user