Page 1 of 1

EAccessViolation during SFTP file download

Posted: Thu 28 Oct 2010 15:04
by rhoadesma
I am evaluating the SecureBridge components using C++ Builder 6 to see if it will work for us. I have run into a problem.

When downloading a 25meg file I am getting an EAccessViolation in the middle of the download. If I comment out the RetrieveAttributes line, the download completes successfully.

Is this a bug in the components or am I doing something wrong?

TScSSHClient *SSHClient = new TScSSHClient( this );
TScFileStorage *KeyFileStorage = new TScFileStorage( this );
SSHClient->KeyStorage = KeyFileStorage;
SSHClient->Authentication = atPassword;
SSHClient->Port = 22;
SSHClient->HostName = "xxx";
SSHClient->User = "xxx";
SSHClient->Password = "xxx";

TScSFTPClient *SFTPClient = new TScSFTPClient( this );
SFTPClient->SSHClient = SSHClient;
SFTPClient->Version = vSFTP6;

// Initialize session
SSHClient->Connect();
SFTPClient->Initialize();

// Get the file size
TScSFTPFileAttributes *Attributes = new TScSFTPFileAttributes;
SFTPClient->RetrieveAttributes( Attributes, "/downloadtest.bin", false, TScSFTPAttributes()Size;
delete Attributes;

// Download the file
SFTPClient->DownloadFile("/downloadtest.bin", "c:\downloadtest.bin", true );

// Finish/cleanup
SFTPClient->Disconnect();
SSHClient->Disconnect();
delete SFTPClient;
delete SSHClient;
delete KeyFileStorage;

Posted: Fri 29 Oct 2010 09:02
by Dimon
I could not reproduce the problem.
Please let us know the version of your SSH server and the exact version of SecureBridge.

Posted: Fri 29 Oct 2010 22:39
by rhoadesma
I am using WinSSHD 5.15.

I created an account on my server so you can test with it. I will PM you the details.

Posted: Mon 01 Nov 2010 11:41
by Dimon
Thank you for information. We have reproduced this problem and fixed it. This fix will be included in the next SecureBridge build.