From 64df2cd90f8527e21930b1ec5cba823692175dc8 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Thu, 29 Nov 2001 20:27:20 +0000 Subject: [PATCH] Remember to terminate the prompt string in keyboard-interactive [originally from svn r1425] --- ssh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/ssh.c b/ssh.c index 3a02b129..baa811fb 100644 --- a/ssh.c +++ b/ssh.c @@ -4155,6 +4155,8 @@ static void do_ssh2_authconn(unsigned char *in, int inlen, int ispkt) ssh2_pkt_getstring(&prompt, &prompt_len); strncpy(pwprompt, prompt, sizeof(pwprompt)); + pwprompt[prompt_len < sizeof(pwprompt) ? + prompt_len : sizeof(pwprompt)-1] = '\0'; need_pw = TRUE; echo = ssh2_pkt_getbool();