Sfoglia il codice sorgente

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 13 anni fa
parent
commit
ffefefc1dc
1 ha cambiato i file con 1 aggiunte e 1 eliminazioni
  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