summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan T. DeKok <aland@freeradius.org>2015-10-31 10:31:11 -0400
committerAlan T. DeKok <aland@freeradius.org>2015-10-31 10:31:25 -0400
commit6bae92df885602b2558333bdb6d2db67d1365683 (patch)
tree8352d7bca1caf1554bb1ee2c1f5d1415fee347a6
parent6aecbff46e4945f0035e476a1fcd16d4713d6127 (diff)
downloadlibpam-radius-auth-6bae92df885602b2558333bdb6d2db67d1365683.tar.gz
libpam-radius-auth-6bae92df885602b2558333bdb6d2db67d1365683.zip
Clear out trailing part of the buffer
-rw-r--r--src/pam_radius_auth.c2
1 files changed, 1 insertions, 1 deletions
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);