From 24c9cfc800c5e81819d80fd3eda953f950e263d6 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Wed, 15 Feb 2017 06:03:50 +0000 Subject: [PATCH] Windows Plink: treat EOF at host key prompt as 'abort connection'. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 | 2 ++ 1 file changed, 2 insertions(+) diff --git a/windows/wincons.c b/windows/wincons.c index d7b95704..efdecd58 100644 --- a/windows/wincons.c +++ b/windows/wincons.c @@ -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 |