summaryrefslogtreecommitdiffstats
path: root/source4
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2009-11-30 17:47:56 +1100
committerAndrew Tridgell <tridge@samba.org>2009-11-30 18:15:31 +1100
commit8331b4c4f8ff1cab6fef2e402a3fda3a95ea091d (patch)
tree5785e7bf3a688790144826d3fb56f35dbd76afb2 /source4
parenta5e0f433de3e3890be0af64c26665daca658e4b6 (diff)
downloadsamba-8331b4c4f8ff1cab6fef2e402a3fda3a95ea091d.tar.gz
samba-8331b4c4f8ff1cab6fef2e402a3fda3a95ea091d.tar.xz
samba-8331b4c4f8ff1cab6fef2e402a3fda3a95ea091d.zip
s4-ldb: check for -ve value for page size
This comes from a tip from Howard Chu. Apparently some clients will send a -ve page size value.
Diffstat (limited to 'source4')
-rw-r--r--source4/lib/ldb/modules/paged_results.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/source4/lib/ldb/modules/paged_results.c b/source4/lib/ldb/modules/paged_results.c
index 774109ff06d..ff1b92ff97e 100644
--- a/source4/lib/ldb/modules/paged_results.c
+++ b/source4/lib/ldb/modules/paged_results.c
@@ -326,6 +326,11 @@ static int paged_search(struct ldb_module *module, struct ldb_request *req)
ac->module = module;
ac->req = req;
ac->size = paged_ctrl->size;
+ if (ac->size < 0) {
+ /* apparently some clients send more than 2^31. This
+ violates the ldap standard, but we need to cope */
+ ac->size = 0x7FFFFFFF;
+ }
/* check if it is a continuation search the store */
if (paged_ctrl->cookie_len == 0) {