We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent c033292 commit 50cb424Copy full SHA for 50cb424
test/unittest/valuetest.cpp
@@ -1119,6 +1119,16 @@ TEST(Value, Array) {
1119
z.SetArray();
1120
EXPECT_TRUE(z.IsArray());
1121
EXPECT_TRUE(z.Empty());
1122
+
1123
+ // PR #1503: assign from inner Value
1124
+ {
1125
+ CrtAllocator a; // Free() is not a noop
1126
+ GenericValue<UTF8<>, CrtAllocator> nullValue;
1127
+ GenericValue<UTF8<>, CrtAllocator> arrayValue(kArrayType);
1128
+ arrayValue.PushBack(nullValue, a);
1129
+ arrayValue = arrayValue[0]; // shouldn't crash (use after free)
1130
+ EXPECT_TRUE(arrayValue.IsNull());
1131
+ }
1132
}
1133
1134
TEST(Value, ArrayHelper) {
0 commit comments