From ea91a8cc67ce3e5a946ddb9e55ae6387a216a90e Mon Sep 17 00:00:00 2001 From: Lukas Braun <lukas.braun@fau.de> Date: Mon, 28 Aug 2017 15:40:31 +0200 Subject: [PATCH] pam_goatherd: replace incorrect constant by sizeof str_fail is 6 chars including \0. --- pam_goatherd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pam_goatherd.c b/pam_goatherd.c index 06a50a9..56199ba 100644 --- a/pam_goatherd.c +++ b/pam_goatherd.c @@ -198,7 +198,8 @@ static int check_hotp(struct cfg cfg, size_t n_server, const char *user, const c goto bye; } - char buf[5]; + // str_fail is the biggest expected response string + char buf[sizeof(str_fail)]; ssize_t recvd; if ((recvd = gnutls_record_recv(session, &buf, sizeof(buf) - 1)) < 0) { -- GitLab