mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-09 11:09:32 +01:00
Make GenericSchemaDocument constructor explicit
Prior to this change, a user could incorrectly pass a Document object to SchemaValidator. This would implicitly construct a SchemaDocument, which would then be destructed before the validator was used. This caused unpredictable results including memory corruption and program crashes.
This commit is contained in:
parent
727e2b958d
commit
899156172d
@ -1338,7 +1338,7 @@ public:
|
||||
\param remoteProvider An optional remote schema document provider for resolving remote reference. Can be null.
|
||||
\param allocator An optional allocator instance for allocating memory. Can be null.
|
||||
*/
|
||||
GenericSchemaDocument(const ValueType& document, IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) :
|
||||
explicit GenericSchemaDocument(const ValueType& document, IRemoteSchemaDocumentProviderType* remoteProvider = 0, Allocator* allocator = 0) :
|
||||
remoteProvider_(remoteProvider),
|
||||
allocator_(allocator),
|
||||
ownAllocator_(),
|
||||
|
Loading…
x
Reference in New Issue
Block a user