Fixed an access violation in DynamicJsonBuffer when memory allocation fails (issue #433)

This commit is contained in:
Benoit Blanchon committed 2017-01-31 10:06:40 +01:00
1 parent 3fd87e8e82
commit db9a76f7c6
4 files changed
+18 -4

No files matched your search

@@ -43,3 +43,9 @@ TEST_F(DynamicJsonBuffer_NoMemory_Tests, ParseObject) {
char json[] = "{}";
ASSERT_FALSE(_jsonBuffer.parseObject(json).success());
}
TEST_F(DynamicJsonBuffer_NoMemory_Tests, String) {
DynamicJsonBufferBase<NoMemoryAllocator>::String str = _jsonBuffer.startString();
str.append('!');
ASSERT_EQ(NULL, str.c_str());
}