summaryrefslogtreecommitdiffstats
path: root/contrib/opie
diff options
context:
space:
mode:
authordim <dim@FreeBSD.org>2013-02-16 12:45:57 +0000
committerdim <dim@FreeBSD.org>2013-02-16 12:45:57 +0000
commit581bacc0c7e225816fb6977d49c3784ff0cfc0e9 (patch)
tree43f5eff63573807699388cb4266c3352088a0c8d /contrib/opie
parent2fd1909d3a78ec1b44c47cf82d615bb9b8a12063 (diff)
downloadFreeBSD-src-581bacc0c7e225816fb6977d49c3784ff0cfc0e9.zip
FreeBSD-src-581bacc0c7e225816fb6977d49c3784ff0cfc0e9.tar.gz
In contrib/opie/opiekey.c, use the correct length to zero the secret.
Found by: clang ToT Reviewed by: delphij MFC after: 3 days
Diffstat (limited to 'contrib/opie')
-rw-r--r--contrib/opie/opiekey.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/contrib/opie/opiekey.c b/contrib/opie/opiekey.c
index 20ba658..6988349 100644
--- a/contrib/opie/opiekey.c
+++ b/contrib/opie/opiekey.c
@@ -109,19 +109,19 @@ static void getsecret FUNCTION((secret, promptextra, retype), char *secret AND c
if (!opiereadpass(verify, OPIE_SECRET_MAX, 0)) {
fprintf(stderr, "Error reading %ssecret pass phrase!\n", promptextra);
memset(verify, 0, sizeof(verify));
- memset(secret, 0, sizeof(secret));
+ memset(secret, 0, OPIE_SECRET_MAX + 1);
exit(1);
}
if (verify[0] && strcmp(verify, secret)) {
fprintf(stderr, "They don't match. Try again.\n");
memset(verify, 0, sizeof(verify));
- memset(secret, 0, sizeof(secret));
+ memset(secret, 0, OPIE_SECRET_MAX + 1);
exit(1);
}
memset(verify, 0, sizeof(verify));
}
if (!(flags & 2) && !aflag && opiepasscheck(secret)) {
- memset(secret, 0, sizeof(secret));
+ memset(secret, 0, OPIE_SECRET_MAX + 1);
fprintf(stderr, "Secret pass phrases must be between %d and %d characters long.\n", OPIE_SECRET_MIN, OPIE_SECRET_MAX);
exit(1);
};
OpenPOWER on IntegriCloud