Patches to prevent a couple of silly crashes
[u/mdw/putty] / sftp.c
diff --git a/sftp.c b/sftp.c
index abd940a..e7b8441 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;