mirror of
https://github.com/Tencent/rapidjson.git
synced 2025-03-06 13:41:35 +01:00
Fixed Issue 22 memory corruption via operator =
git-svn-id: https://rapidjson.googlecode.com/svn/trunk@74 c5894555-1306-4e8d-425f-1f6f381ee07c
This commit is contained in:
parent
152c2eff6c
commit
9fb77b114b
@ -801,6 +801,9 @@ public:
|
||||
}
|
||||
|
||||
private:
|
||||
// Prohibit assignment
|
||||
GenericDocument& operator=(const GenericDocument&);
|
||||
|
||||
void ClearStack() {
|
||||
if (Allocator::kNeedFree)
|
||||
while (stack_.GetSize() > 0) // Here assumes all elements in stack array are GenericValue (Member is actually 2 GenericValue objects)
|
||||
|
@ -82,3 +82,11 @@ TEST(Document, UTF16_Document) {
|
||||
|
||||
EXPECT_EQ(0, wcscmp(L"Wed Oct 30 17:13:20 +0000 2012", s.GetString()));
|
||||
}
|
||||
|
||||
// Issue 22: Memory corruption via operator=
|
||||
// Fixed by making unimplemented assignment operator private.
|
||||
//TEST(Document, Assignment) {
|
||||
// Document d1;
|
||||
// Document d2;
|
||||
// d1 = d2;
|
||||
//}
|
||||
|
Loading…
x
Reference in New Issue
Block a user