From: Jake Farrell Date: Thu, 15 Dec 2011 20:50:31 +0000 (+0000) Subject: Thrift-1467:Possible AV with empty strings when using JSON protocol X-Git-Tag: 0.9.1~485 X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=a2a9ee993e0fb7607ab1bf4173b7037e3c317c28;p=common%2Fthrift.git Thrift-1467:Possible AV with empty strings when using JSON protocol Client:delphi Patch: Jens Geyer Fixes exception raised on empty json strings. git-svn-id: https://svn.apache.org/repos/asf/thrift/trunk@1214955 13f79535-47bb-0310-9956-ffa450edef68 --- diff --git a/lib/delphi/src/Thrift.Protocol.JSON.pas b/lib/delphi/src/Thrift.Protocol.JSON.pas index 6fd64933..34338d59 100644 --- a/lib/delphi/src/Thrift.Protocol.JSON.pas +++ b/lib/delphi/src/Thrift.Protocol.JSON.pas @@ -842,7 +842,7 @@ begin end; SetLength( result, buffer.Size); - Move( buffer.Memory^, result[0], Length(result)); + if buffer.Size > 0 then Move( buffer.Memory^, result[0], Length(result)); finally buffer.Free;