memory leak in putty PSCP
From: Volker Wehrhahn (v.wehrhahn@autoonline-gmbh.de)Date: 02/28/02
- Next message: Jason Price: "Re: ssh passwd -f in a restricted shell"
- Previous message: Richard E. Silverman: "Re: OpenSSH hostbased auth: known_hosts format"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "Volker Wehrhahn" <v.wehrhahn@autoonline-gmbh.de> Date: Thu, 28 Feb 2002 15:28:21 +0100
Hello,
im using Putty Version 0.52.
I think i have found a memory leak in Program PSCP.
I changed the Funktion fxp_read() in File SFTP.C and the leak disapers.
//sfree(pktin); <---- Original
sftp_pkt_free(pktin); // <-- Changed
HTH
Volker Wehrhahn
V.Wehrhahnh@autoonline-gmbh.de
....
int fxp_read(struct fxp_handle *handle, char *buffer, uint64 offset,
int len)
{
struct sftp_packet *pktin, *pktout;
int id;
pktout = sftp_pkt_init(SSH_FXP_READ);
sftp_pkt_adduint32(pktout, 0xBCD); /* request id */
sftp_pkt_addstring_start(pktout);
sftp_pkt_addstring_data(pktout, handle->hstring, handle->hlen);
sftp_pkt_adduint64(pktout, offset);
sftp_pkt_adduint32(pktout, len);
sftp_send(pktout);
pktin = sftp_recv();
if (!pktin) {
fxp_internal_error("did not receive a valid SFTP packet\n");
return -1;
}
id = sftp_pkt_getuint32(pktin);
if (id != 0xBCD) {
fxp_internal_error("request ID mismatch");
return -1;
}
if (pktin->type == SSH_FXP_DATA) {
char *str;
int rlen;
sftp_pkt_getstring(pktin, &str, &rlen);
if (rlen > len || rlen < 0) {
fxp_internal_error("READ returned more bytes than requested");
return -1;
}
memcpy(buffer, str, rlen);
//sfree(pktin); <---- Original
sftp_pkt_free(pktin); // <-- Changed
return rlen;
} else {
fxp_got_status(pktin);
return -1;
}
}
....
- Next message: Jason Price: "Re: ssh passwd -f in a restricted shell"
- Previous message: Richard E. Silverman: "Re: OpenSSH hostbased auth: known_hosts format"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|
|