summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Hedenfal <martinh@cvs.openbsd.org>2010-10-19 09:20:49 +0000
committerMartin Hedenfal <martinh@cvs.openbsd.org>2010-10-19 09:20:49 +0000
commit3706d6391974771c1711af9a4ffb67f572baaed7 (patch)
tree82eedba61fc2d8f07da4b99b78860c9f1cb84822
parentc7bf049c4c12d4d68c32757aed3dd6a1a6be2d75 (diff)
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;
}