Skip to content

AV in TIdFTP.Get() in D5 #50

Description

@rlebeau

Excecuting TIdFTP.Get() results in an access violation in D5. See attached call stack. The call to Get is Get('cashmondat.zip', 'cashmondat.zip', True, false).

TIdTextEncoding.GetByteCount(TIdWideChars, Integer, Integer) is being passed an invalid ACharCount parameter value. The corrupted value would have to be coming from the call to Length(AChars) in TIdTextEncoding.GetByteCount(TIdWideChars). TIdWideChars is an array of WideChar in D5, and the call stack shows valid contents for the array in the AChars parameter of GetByteCount().

Stepping inside the CPU window into:

Result := GetByteCount(@AChars[ACharIndex], ACharCount);

call dword ptr [ebx] uses a wrong address.

Previous calls that worked ok used EAX=73EB8, now it uses 6DDAFF instead. This results to the wrong value in EBX.

Metadata

Metadata

Assignees

Labels

Element: Compiler/IDEIssues related to a particular Compiler and/or IDEElement: FTPIssues related to FTP handling, TIdFTP and TIdFTPServer, etcStatus: On HoldIssue is on hold at this time, may be worked on laterType: BugIssue is a bug in existing code

Type

No type

Projects

Status
No status

Relationships

None yet

Development

No branches or pull requests

Issue actions