From 6bae92df885602b2558333bdb6d2db67d1365683 Mon Sep 17 00:00:00 2001 From: "Alan T. DeKok" Date: Sat, 31 Oct 2015 10:31:11 -0400 Subject: Clear out trailing part of the buffer --- src/pam_radius_auth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') diff --git a/src/pam_radius_auth.c b/src/pam_radius_auth.c index 694e7b4..90d074a 100644 --- a/src/pam_radius_auth.c +++ b/src/pam_radius_auth.c @@ -535,8 +535,8 @@ static void add_password(AUTH_HDR *request, unsigned char type, CONST char *pass length &= ~(AUTH_PASS_LEN - 1); /* chop it off */ } /* 16*N maps to itself */ - memset(hashed, 0, length); memcpy(hashed, password, length); + memset(hashed + length, 0, sizeof(hashed) - length); attr = find_attribute(request, PW_PASSWORD); -- cgit v1.2.3