]> asedeno.scripts.mit.edu Git - PuTTY.git/commitdiff
Windows Plink: treat EOF at host key prompt as 'abort connection'.
authorSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 06:03:50 +0000 (06:03 +0000)
committerSimon Tatham <anakin@pobox.com>
Wed, 15 Feb 2017 06:03:50 +0000 (06:03 +0000)
Thanks to Didrik Nordström for pointing out that we currently treated
it as 'whatever happened to be in line[0] before ReadFile didn't get
any data'.

windows/wincons.c

index d7b95704174fb11a14a5e1e934d1d076bcf4e7cf..efdecd58ec51c44943f6a3e5409cf8f2d314dfb3 100644 (file)
@@ -131,6 +131,8 @@ int verify_ssh_host_key(void *frontend, char *host, int port,
        fflush(stderr);
     }
 
+    line[0] = '\0';         /* fail safe if ReadFile returns no data */
+
     hin = GetStdHandle(STD_INPUT_HANDLE);
     GetConsoleMode(hin, &savemode);
     SetConsoleMode(hin, (savemode | ENABLE_ECHO_INPUT |