From acf50a4f980690bea33092e509ca9236d4e23085 Mon Sep 17 00:00:00 2001 From: Michele Giacomoli Date: Mon, 19 Sep 2022 18:09:38 +0200 Subject: [PATCH] Flush stdin after fingerprint confirmation --- cli-kex.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/cli-kex.c b/cli-kex.c index c3b8846..2824edc 100644 --- a/cli-kex.c +++ b/cli-kex.c @@ -229,6 +229,8 @@ static void ask_to_confirm(const unsigned char* keyblob, unsigned int keybloblen fclose(tty); } else { response = getc(stdin); + // flush stdin buffer + while ((getchar()) != '\n'); } if (response == 'y') {