From 0d694692c59504838ec2043ddfe670b3a9247faf Mon Sep 17 00:00:00 2001 From: simon Date: Tue, 27 Feb 2001 09:11:42 +0000 Subject: [PATCH] Patches to prevent a couple of silly crashes git-svn-id: svn://svn.tartarus.org/sgt/putty@954 cda61777-01e9-0310-a592-d414129be87e --- psftp.c | 1 + sftp.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/psftp.c b/psftp.c index f4c254a5..deef6d83 100644 --- a/psftp.c +++ b/psftp.c @@ -590,6 +590,7 @@ void do_sftp(void) { fprintf(stderr, "Fatal: unable to initialise SFTP: %s\n", fxp_error()); + return; } /* diff --git a/sftp.c b/sftp.c index abd940a4..e7b84412 100644 --- a/sftp.c +++ b/sftp.c @@ -286,6 +286,10 @@ int fxp_init(void) { sftp_send(pktout); pktin = sftp_recv(); + if (!pktin) { + fxp_internal_error("could not connect"); + return 0; + } if (pktin->type != SSH_FXP_VERSION) { fxp_internal_error("did not receive FXP_VERSION"); return 0; -- 2.11.0