diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-07 20:39:30 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2003-05-07 20:39:30 +0000 |
commit | 0c2b752abd56437d368e86a651082c20c56cf5cf (patch) | |
tree | 25f1b82dda49ca5f769862d1d46fa5c0e40c3fb5 /usr.bin | |
parent | 8e66ea946871b2f289f233e4d0dd64fc7a7529a6 (diff) |
bounds were sizeof(pointer) rather than size of the object; found with
anil's gcc bounds checker mod
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/skeyinit/skeyinit.c | 11 | ||||
-rw-r--r-- | usr.bin/sup/src/expand.c | 4 |
2 files changed, 8 insertions, 7 deletions
diff --git a/usr.bin/skeyinit/skeyinit.c b/usr.bin/skeyinit/skeyinit.c index 92f944eda66..1d9c93ec6d5 100644 --- a/usr.bin/skeyinit/skeyinit.c +++ b/usr.bin/skeyinit/skeyinit.c @@ -1,4 +1,4 @@ -/* $OpenBSD: skeyinit.c,v 1.43 2003/04/07 21:13:54 deraadt Exp $ */ +/* $OpenBSD: skeyinit.c,v 1.44 2003/05/07 20:39:29 deraadt Exp $ */ /* OpenBSD S/Key (skeyinit.c) * @@ -39,7 +39,7 @@ #endif void usage(void); -void secure_mode(int *, char *, char *, char *, size_t); +void secure_mode(int *, char *, char *, size_t, char *, size_t); void normal_mode(char *, int, char *, char *); void timedout(int); void convert_db(void); @@ -298,7 +298,7 @@ purpose of using S/Key in the fist place.\n"); alarm(180); if (!defaultsetup) - secure_mode(&n, key, seed, buf, sizeof(buf)); + secure_mode(&n, key, seed, sizeof seed, buf, sizeof(buf)); else normal_mode(pp->pw_name, n, key, seed); alarm(0); @@ -321,7 +321,8 @@ purpose of using S/Key in the fist place.\n"); } void -secure_mode(int *count, char *key, char *seed, char *buf, size_t bufsiz) +secure_mode(int *count, char *key, char *seed, size_t seedlen, + char *buf, size_t bufsiz) { char *p, newseed[SKEY_MAX_SEED_LEN + 2]; int i, n; @@ -373,7 +374,7 @@ secure_mode(int *count, char *key, char *seed, char *buf, size_t bufsiz) break; /* Valid seed */ } if (newseed[0] != '\0') - (void)strlcpy(seed, newseed, sizeof seed); + (void)strlcpy(seed, newseed, seedlen); for (i = 0; ; i++) { if (i >= 2) diff --git a/usr.bin/sup/src/expand.c b/usr.bin/sup/src/expand.c index 01c61b9a5be..efee899cf51 100644 --- a/usr.bin/sup/src/expand.c +++ b/usr.bin/sup/src/expand.c @@ -1,4 +1,4 @@ -/* $OpenBSD: expand.c,v 1.13 2002/02/17 19:42:32 millert Exp $ */ +/* $OpenBSD: expand.c,v 1.14 2003/05/07 20:39:29 deraadt Exp $ */ /* * Copyright (c) 1991 Carnegie Mellon University @@ -143,7 +143,7 @@ glob(as) goto endit; memmove(path, path + 1, strlen(path)); } else - strlcpy(path, home, sizeof path); + strlcpy(path, home, sizeof pathbuf); pathp = path + strlen(path); } } |