summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormartinh <martinh@openbsd.org>2010-10-19 09:20:48 +0000
committermartinh <martinh@openbsd.org>2010-10-19 09:20:48 +0000
commit40d0f1caf430a845ecbc8dd461289683adce3a09 (patch)
treeac57062ed4dabec40d8a6aa5e2b431f284e521b2
parentRemember the bind DN after BSD authentication. This makes access control (diff)
downloadwireguard-openbsd-40d0f1caf430a845ecbc8dd461289683adce3a09.tar.xz
wireguard-openbsd-40d0f1caf430a845ecbc8dd461289683adce3a09.zip
When checking if the input buffer is large enough to hold an LDAP request,
compare with available space, not the total space. This fixes rejection of messages when there are multiple requests queued in the input buffer.
-rw-r--r--usr.sbin/ldapd/ber.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.sbin/ldapd/ber.c b/usr.sbin/ldapd/ber.c
index e69693bc6a1..a56b809049a 100644
--- a/usr.sbin/ldapd/ber.c
+++ b/usr.sbin/ldapd/ber.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ber.c,v 1.4 2010/07/01 04:21:41 martinh Exp $ */
+/* $OpenBSD: ber.c,v 1.5 2010/10/19 09:20:48 martinh Exp $ */
/*
* Copyright (c) 2007 Reyk Floeter <reyk@vantronix.net>
@@ -1067,7 +1067,7 @@ ber_read_element(struct ber *ber, struct ber_element *elm)
/* If using an external buffer and the total size of the element
* is larger then the external buffer don't bother to continue. */
- if (ber->fd == -1 && totlen > ber->br_rend - ber->br_rbuf) {
+ if (ber->fd == -1 && len > ber->br_rend - ber->br_rptr) {
errno = ECANCELED;
return -1;
}