diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-22 04:12:49 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2013-11-22 04:12:49 +0000 |
commit | f34a9f0a9d06ba7a8b2ff945df3a26db7970c69b (patch) | |
tree | d57205672d49f3cdb33f1fc9a1a8f910adf8c9f9 /sbin/iked | |
parent | 04e705a232d9b6abc44accfde7b9a33fe3e19510 (diff) |
Whole bunch of (unsigned char) casts carefully added for ctype calls.
Careful second audit by millert
Diffstat (limited to 'sbin/iked')
-rw-r--r-- | sbin/iked/parse.y | 6 | ||||
-rw-r--r-- | sbin/iked/util.c | 8 |
2 files changed, 7 insertions, 7 deletions
diff --git a/sbin/iked/parse.y b/sbin/iked/parse.y index 83b6d318442..d9f3f93e365 100644 --- a/sbin/iked/parse.y +++ b/sbin/iked/parse.y @@ -1,4 +1,4 @@ -/* $OpenBSD: parse.y,v 1.30 2013/03/21 04:30:14 deraadt Exp $ */ +/* $OpenBSD: parse.y,v 1.31 2013/11/22 04:12:47 deraadt Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -825,7 +825,7 @@ byte_spec : NUMBER { yyerror("invalid byte specification: %s", $1); YYERROR; } - switch (toupper(unit)) { + switch (toupper((unsigned char)unit)) { case 'K': bytes *= 1024; break; @@ -854,7 +854,7 @@ time_spec : NUMBER { yyerror("invalid time specification: %s", $1); YYERROR; } - switch (tolower(unit)) { + switch (tolower((unsigned char)unit)) { case 'm': seconds *= 60; break; diff --git a/sbin/iked/util.c b/sbin/iked/util.c index 3238f7a0db9..f27a68d116d 100644 --- a/sbin/iked/util.c +++ b/sbin/iked/util.c @@ -1,4 +1,4 @@ -/* $OpenBSD: util.c,v 1.20 2013/11/21 17:46:17 millert Exp $ */ +/* $OpenBSD: util.c,v 1.21 2013/11/22 04:12:47 deraadt Exp $ */ /* * Copyright (c) 2010-2013 Reyk Floeter <reyk@openbsd.org> @@ -407,7 +407,7 @@ void lc_string(char *str) { for (; *str != '\0'; str++) - *str = tolower(*str); + *str = tolower((unsigned char)*str); } void @@ -472,7 +472,7 @@ print_bits(u_short v, u_char *bits) } any = 1; for (; (c = *bits) > 32; bits++) { - buf[idx][j++] = tolower(c); + buf[idx][j++] = tolower((unsigned char)c); if (j >= sizeof(buf[idx])) return (buf[idx]); } @@ -619,7 +619,7 @@ get_string(u_int8_t *ptr, size_t len) char *str; for (i = 0; i < len; i++) - if (!isprint((char)ptr[i])) + if (!isprint(ptr[i])) break; if ((str = calloc(1, i + 1)) == NULL) |