From fa1a92f38d52865e522a35ad645d7948a1ecebd9 Mon Sep 17 00:00:00 2001 From: Joshy Date: Mon, 15 Mar 2010 19:05:59 +0000 Subject: [PATCH] Fixes bug 0016003 using patch from Lagunov Aleksey. Zero length read stream reads ALL the stream instead nothing. git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@1181 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/fpspreadsheet/xlsbiff8.pas | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/fpspreadsheet/xlsbiff8.pas b/components/fpspreadsheet/xlsbiff8.pas index f56079f9f..3de7d01d1 100755 --- a/components/fpspreadsheet/xlsbiff8.pas +++ b/components/fpspreadsheet/xlsbiff8.pas @@ -1390,7 +1390,10 @@ begin Dec(PendingRecordSize,2); LString:=''; while PendingRecordSize>0 do begin - LString:=LString+ReadString(AStream,StringLength); + if StringLength>0 then begin + //Read a stream of zero length reads all the stream. + LString:=LString+ReadString(AStream,StringLength); + end; if (PendingRecordSize=0) and (Items>1) then begin //A continue will happend, read the continue //tag and continue linking...