Browse Source

fcl-db: when moving odd number bytes from blob stream into widestring allocate sufficient space. (f.e. if Len=1 then Len div 2 = 0)

git-svn-id: trunk@22995 -
lacak 12 years ago
parent
commit
ffefefc1dc
1 changed files with 1 additions and 1 deletions
  1. 1 1
      packages/fcl-db/src/base/fields.inc

+ 1 - 1
packages/fcl-db/src/base/fields.inc

@@ -2729,7 +2729,7 @@ begin
     With Stream do
       try
         Len := Size;
-        SetLength(Result,Len div 2);
+        SetLength(Result, (Len+1) div 2);
         if Len > 0 then
           ReadBuffer(Result[1] ,Len);
       finally