]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Patches to prevent a couple of silly crashes
authorSimon Tatham <anakin@pobox.com>
Tue, 27 Feb 2001 09:11:42 +0000 (09:11 +0000)
committerSimon Tatham <anakin@pobox.com>
Tue, 27 Feb 2001 09:11:42 +0000 (09:11 +0000)
[originally from svn r954]

psftp.c
sftp.c

diff --git a/psftp.c b/psftp.c
index f4c254a5d6ebd6440e8752740b975ce267bde89d..deef6d83ee29c0fc3aa64eda37c9d4d322f06c14 100644 (file)
--- 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 abd940a4e1880c9860d417c9024867ee6dc640f8..e7b84412192e4fba45d9854a9c6e77d1ce168084 100644 (file)
--- 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;