summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ldapd
diff options
context:
space:
mode:
authorderaadt <deraadt@openbsd.org>2019-02-13 22:57:07 +0000
committerderaadt <deraadt@openbsd.org>2019-02-13 22:57:07 +0000
commit915c3f33d30399505d94a06fc5123e4bbdc9531f (patch)
treeee3b909e9fc1fb29e610142968bc73a972634746 /usr.sbin/ldapd
parentsync (diff)
downloadwireguard-openbsd-915c3f33d30399505d94a06fc5123e4bbdc9531f.tar.xz
wireguard-openbsd-915c3f33d30399505d94a06fc5123e4bbdc9531f.zip
(unsigned) means (unsigned int) which on ptrdiff_t or size_t or other
larger types really is a range reduction... Almost any cast to (unsigned) is a bug. ok millert tb benno
Diffstat (limited to 'usr.sbin/ldapd')
-rw-r--r--usr.sbin/ldapd/parse.y6
-rw-r--r--usr.sbin/ldapd/schema.c4
2 files changed, 5 insertions, 5 deletions
diff --git a/usr.sbin/ldapd/parse.y b/usr.sbin/ldapd/parse.y
index 4e2766a699d..bad9bc63040 100644
--- a/usr.sbin/ldapd/parse.y
+++ b/usr.sbin/ldapd/parse.y
@@ -1,4 +1,4 @@
-/* $OpenBSD: parse.y,v 1.34 2018/11/01 00:18:44 sashan Exp $ */
+/* $OpenBSD: parse.y,v 1.35 2019/02/13 22:57:08 deraadt Exp $ */
/*
* Copyright (c) 2009, 2010 Martin Hedenfalk <martinh@openbsd.org>
@@ -682,7 +682,7 @@ top:
if (c == '-' || isdigit(c)) {
do {
*p++ = c;
- if ((unsigned)(p-buf) >= sizeof(buf)) {
+ if ((size_t)(p-buf) >= sizeof(buf)) {
yyerror("string too long");
return (findeol());
}
@@ -721,7 +721,7 @@ nodigits:
if (isalnum(c) || c == ':' || c == '_' || c == '*') {
do {
*p++ = c;
- if ((unsigned)(p-buf) >= sizeof(buf)) {
+ if ((size_t)(p-buf) >= sizeof(buf)) {
yyerror("string too long");
return (findeol());
}
diff --git a/usr.sbin/ldapd/schema.c b/usr.sbin/ldapd/schema.c
index 1bf275ffd02..448a5b24521 100644
--- a/usr.sbin/ldapd/schema.c
+++ b/usr.sbin/ldapd/schema.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: schema.c,v 1.17 2017/01/20 11:55:08 benno Exp $ */
+/* $OpenBSD: schema.c,v 1.18 2019/02/13 22:57:08 deraadt Exp $ */
/*
* Copyright (c) 2010 Martin Hedenfalk <martinh@openbsd.org>
@@ -401,7 +401,7 @@ top:
if (isalnum(c) || c == ':' || c == '_' || c == '*') {
do {
*p++ = c;
- if ((unsigned)(p-buf) >= sizeof(buf)) {
+ if ((size_t)(p-buf) >= sizeof(buf)) {
log_warnx("string too long");
return (findeol(schema));
}