client: Fix maximum banner length

According to RFC 4253 the max banner length is 255.

Thanks to Saju Panikulam <spanikulam@ipswitch.com> for the report.

Signed-off-by: Andreas Schneider <asn@cryptomilk.org>
(cherry picked from commit cb52ed7b12)
This commit is contained in:
Andreas Schneider
2016-05-02 09:15:28 +02:00
parent 04a5d5bd74
commit bf3d8f3ad4

View File

@@ -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,