Re: [Indy] another bugs found and fixed about IdFTPServer

Giganews Newsgroups
Subject: Re: [Indy] another bugs found and fixed about IdFTPServer
Posted by:  Riceball LEE (ricebal…@Hotmail.com)
Date: Wed, 16 Mar 2005

All r Indy10 IndFTPServer bugs:
* [Bug] IdFTPServer: CommandList if client do not open a channel this
would raise Access violation and memory leak(LStream):
  450 Access violation at address 00488D8E in module 'IdFTPServer.exe'.
Write of address 00000028
  Fixed: Now if no data channel then directly send it.

procedure TIdFTPServer.CommandLIST(ASender: TIdCommand);
....
        LSendData := True;
      finally
        if LSendData then
        begin
          //it should be safe to assume that the FDataChannel object
exists because
          //we checked it earlier (where do you check it?)
          //No it is NOT safe when the client do not open a channel and
try to execute it!
          if Assigned(FDataChannel) then //<-- added by riceball
          begin
          ....
          end
          else begin //no data channel, so directly send it.
            try

LF.Connection.IOHandler.WriteLn(Format('213-%s',[RSFTPDataConnToOpen]));
{Do not Localize}
              LF.Connection.IOHandler.Write(LStream);
              ASender.PerformReply := true;
              ASender.Reply.SetReply(213, RSFTPCmdEndOfStat);
            finally
              FreeAndNil(LStream);
            end;
          end;

Replies

In response to

[Indy] another bugs found and fixed about IdFTPServer posted by Riceball LEE on Mon, 14 Mar 2005