diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-11-21 01:47:11 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2013-11-21 01:47:11 +0000 |
commit | b79aca8921795dc6b8b1d6298bc13a83b4908469 (patch) | |
tree | 910969219267d9c8480cfefc4128549c37f41ec2 /usr.bin | |
parent | 294c3d4b5aa249a853c1c2e59aef2a15e6254f61 (diff) |
My audit of mandoc revealed two missing (unsigned char) casts
in isspace() and tolower() arguments containing arbitrary char data.
Thanks to deraadt@ for triggering the audit.
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/mandocdb.c | 4 | ||||
-rw-r--r-- | usr.bin/mandoc/manpath.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c index c5110e4b418..754c09af0d6 100644 --- a/usr.bin/mandoc/mandocdb.c +++ b/usr.bin/mandoc/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.45 2013/10/05 21:17:29 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.46 2013/11/21 01:47:10 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> @@ -716,7 +716,7 @@ index_merge(const struct of *of, struct mparse *mp, } buf_appendb(buf, ")", 2); for (p = buf->cp; '\0' != *p; p++) - *p = tolower(*p); + *p = tolower((unsigned char)*p); key.data = buf->cp; key.size = buf->len; val.data = NULL; diff --git a/usr.bin/mandoc/manpath.c b/usr.bin/mandoc/manpath.c index a22c23e3113..3e7a45ba423 100644 --- a/usr.bin/mandoc/manpath.c +++ b/usr.bin/mandoc/manpath.c @@ -1,4 +1,4 @@ -/* $Id: manpath.c,v 1.6 2013/05/29 23:15:11 schwarze Exp $ */ +/* $Id: manpath.c,v 1.7 2013/11/21 01:47:10 schwarze Exp $ */ /* * Copyright (c) 2011 Ingo Schwarze <schwarze@openbsd.org> * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> @@ -159,7 +159,7 @@ manpath_manconf(struct manpaths *dirs, const char *file) if (strncmp(MAN_CONF_KEY, p, keysz)) continue; p += keysz; - while (isspace(*p)) + while (isspace((unsigned char)*p)) p++; if ('\0' == *p) continue; |