From cb52ed7b1253fab98f00e4dc078ad5db6d793021 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Mon, 2 May 2016 09:15:28 +0200 Subject: [PATCH] client: Fix maximum banner length According to RFC 4253 the max banner length is 255. Thanks to Saju Panikulam for the report. Signed-off-by: Andreas Schneider --- src/client.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/client.c b/src/client.c index a29f35e4..b437bfcc 100644 --- a/src/client.c +++ b/src/client.c @@ -145,7 +145,8 @@ static int callback_receive_banner(const void *data, size_t len, void *user) break; } } - if (i > 127) { + /* According to RFC 4253 the max banner length is 255 */ + if (i > 255) { /* Too big banner */ session->session_state=SSH_SESSION_STATE_ERROR; ssh_set_error(session,