Fix segfault when you press a key before the SSH protocol decides whether
[sgt/putty] / ssh.c
diff --git a/ssh.c b/ssh.c
index 26379e1..d2eb302 100644 (file)
--- a/ssh.c
+++ b/ssh.c
@@ -2680,7 +2680,7 @@ static char *ssh_init (char *host, int port, char **realhost) {
  * Called to send data down the Telnet connection.
  */
 static void ssh_send (char *buf, int len) {
-    if (s == NULL)
+    if (s == NULL || ssh_protocol == NULL)
        return;
 
     ssh_protocol(buf, len, 0);