diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-01-08 02:26:10 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-01-08 02:26:10 +0000 |
commit | dfc0b5e5a4d2654f157beabd6db58956310010b1 (patch) | |
tree | 6b4bb5b13c3bfcf43df9b40d0b81c2219347de42 /lib | |
parent | 7651ba744afee68bf52b751d205928cd5a04d924 (diff) |
More int's that should be size_t for strlen() use
ok millert
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libc/gen/auth_subr.c | 8 | ||||
-rw-r--r-- | lib/libc/gen/exec.c | 5 |
2 files changed, 8 insertions, 5 deletions
diff --git a/lib/libc/gen/auth_subr.c b/lib/libc/gen/auth_subr.c index e2612078e03..46c1011800c 100644 --- a/lib/libc/gen/auth_subr.c +++ b/lib/libc/gen/auth_subr.c @@ -1,4 +1,4 @@ -/* $OpenBSD: auth_subr.c,v 1.36 2009/01/15 13:14:30 millert Exp $ */ +/* $OpenBSD: auth_subr.c,v 1.37 2013/01/08 02:26:09 deraadt Exp $ */ /* * Copyright (c) 2000-2002,2004 Todd C. Miller <Todd.Miller@courtesan.com> @@ -556,7 +556,7 @@ void auth_clroption(auth_session_t *as, char *option) { struct authopts *opt, *oopt; - int len; + size_t len; len = strlen(option); @@ -1061,7 +1061,9 @@ static void _add_rmlist(auth_session_t *as, char *file) { struct rmfiles *rm; - int i = strlen(file) + 1; + size_t i = strlen(file) + 1; + + // XXX should rangecheck i since we are about to add? if ((rm = malloc(sizeof(struct rmfiles) + i)) == NULL) { syslog(LOG_ERR, "Failed to allocate rmfiles: %m"); diff --git a/lib/libc/gen/exec.c b/lib/libc/gen/exec.c index 0bd0b58fdbb..bc3301f47e9 100644 --- a/lib/libc/gen/exec.c +++ b/lib/libc/gen/exec.c @@ -1,4 +1,4 @@ -/* $OpenBSD: exec.c,v 1.19 2012/03/21 23:20:35 matthew Exp $ */ +/* $OpenBSD: exec.c,v 1.20 2013/01/08 02:26:09 deraadt Exp $ */ /*- * Copyright (c) 1991, 1993 * The Regents of the University of California. All rights reserved. @@ -131,7 +131,8 @@ int execvpe(const char *name, char *const *argv, char *const *envp) { char **memp; - int cnt, lp, ln, len; + int cnt; + size_t lp, ln, len; char *p; int eacces = 0; char *bp, *cur, *path, buf[MAXPATHLEN]; |