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

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

View File

@@ -84,7 +84,7 @@ class DynamicJsonBufferBase
char* newStart =
static_cast<char*>(_parent->allocInNewBlock(_length + 1));
if (_start && newStart) memcpy(newStart, _start, _length);
newStart[_length] = c;
if (newStart) newStart[_length] = c;
_start = newStart;
}
_length++;