Memo Causing Access Violation

Posted by Lawrence Karthauser on  2003-03-27 17:00:00

DBase3 and Clipper databases with memo files can generate an Access Violation when the memo length is exactly 510 characters.


status: CLOSED    Urgency: HIGH    As Of: 2003-03-27 17:00:00

Comment:

Corrective Fix:

In gs6_memo.pas, replace GSobjMemo.moMemoPutLast as follows:

Procedure GSobjMemo.moMemoPutLast(ps: PChar);
begin
   ps[0] := #$1A;
   ps[1] := #$1A;
{   StrCopy(ps,#$1A#$1A);}
end;

The descendant methods for dBase4 and FoxPro are empty, since only dBase3 and Clipper insert escape characters at the end of the memo.

The StrCopy wanted 3 bytes and only 2 were available in the assigned buffer.