What steps will reproduce the problem?
1. Parse some JSON string where that string is longer than 50 characters
What is the expected output? What do you see instead?
The string would be parsed and returned as a JSON string.
What version of the product are you using? On what operating system?
2.2
Please provide any additional information below.
The bug is at the bottom of the ParseJSONString function. When longer than 50
chars a TWriteOnlyBlockStream is used, but when the string is "built" at the
end of the function the remaining portion is written over the start of the
resultant string.
My fix is:
if wobs<>nil then begin
nw:=(wobs.Size div SizeOf(WideChar));
SetLength(Result, n+nw);
wobs.StoreData(Result[1]);
if n>0 then
Move(localBuffer[0], Result[nw+1], n*SizeOf(WideChar));
end else begin
SetLength(Result, n);
if n>0 then
Move(localBuffer[0], Result[1], n*SizeOf(WideChar));
end;
Original issue reported on code.google.com by tony.mur...@gmail.com on 18 Nov 2012 at 4:56
Original issue reported on code.google.com by
tony.mur...@gmail.com
on 18 Nov 2012 at 4:56