Commit 9b13eacd authored by Sergey Kosarevsky's avatar Sergey Kosarevsky

Add 0-character during in-situ numbers-as-strings parsing

parent f83b2c09
......@@ -1290,9 +1290,10 @@ private:
if (parseFlags & kParseInsituFlag) {
s.Pop(); // Pop stack no matter if it will be used or not.
typename InputStream::Ch *head = is.PutBegin();
typename InputStream::Ch* head = is.PutBegin();
const size_t length = s.Tell() - startOffset;
RAPIDJSON_ASSERT(length <= 0xFFFFFFFF);
*(head + length) = '\0';
const typename TargetEncoding::Ch* const str = reinterpret_cast<typename TargetEncoding::Ch*>(head);
cont = handler.RawNumber(str, SizeType(length), false);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment