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 | |
parent | 8e66ea946871b2f289f233e4d0dd64fc7a7529a6 (diff) |
bounds were sizeof(pointer) rather than size of the object; found with
anil's gcc bounds checker mod
-rw-r--r-- | kerberosIV/src/lib/krb/kntoln.c | 2 | ||||
-rw-r--r-- | usr.bin/skeyinit/skeyinit.c | 11 | ||||
-rw-r--r-- | usr.bin/sup/src/expand.c | 4 | ||||
-rw-r--r-- | usr.sbin/bind/lib/dns/rbt.c | 2 |
4 files changed, 10 insertions, 9 deletions
diff --git a/kerberosIV/src/lib/krb/kntoln.c b/kerberosIV/src/lib/krb/kntoln.c index 8843204abb0..e425560ed58 100644 --- a/kerberosIV/src/lib/krb/kntoln.c +++ b/kerberosIV/src/lib/krb/kntoln.c @@ -61,7 +61,7 @@ krb_kntoln(AUTH_DAT *ad, char *lname) return(KFAILURE); if (strcmp(ad->prealm, lrealm)) return(KFAILURE); - strlcpy(lname, ad->pname, sizeof lname); + strlcpy(lname, ad->pname, ANAME_SZ); return(KSUCCESS); } 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); } } diff --git a/usr.sbin/bind/lib/dns/rbt.c b/usr.sbin/bind/lib/dns/rbt.c index c2eb16d69c1..3dd6ce5fc34 100644 --- a/usr.sbin/bind/lib/dns/rbt.c +++ b/usr.sbin/bind/lib/dns/rbt.c @@ -1526,7 +1526,7 @@ dns_rbt_formatnodename(dns_rbtnode_t *node, char *printname, unsigned int size) if (result == ISC_R_SUCCESS) dns_name_format(name, printname, size); else - snprintf(printname, sizeof(printname), + snprintf(printname, size, "<error building name: %s>", dns_result_totext(result)); |