summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Bartlett <abartlet@samba.org>2008-01-23 08:57:16 +1100
committerAndrew Bartlett <abartlet@samba.org>2008-01-23 08:57:16 +1100
commit593e6fc40372747806f23105757d0395f9c33377 (patch)
tree343225d0d22f00fdad3a025097f7643d19d46e12
parent24efc9fc36194d379838eb9911b65e93535da19b (diff)
downloadsamba-593e6fc40372747806f23105757d0395f9c33377.tar.gz
samba-593e6fc40372747806f23105757d0395f9c33377.tar.bz2
samba-593e6fc40372747806f23105757d0395f9c33377.zip
ranged_results: fix use of uninitialised variable (end)
This matches the range parsing in the search and callback - end was uninitilaised, causing occasional failures in make test. Andrew Bartlett (This used to be commit 669f137f0ecad10248a51b337c8f115d14d55b05)
-rw-r--r--source4/dsdb/samdb/ldb_modules/ranged_results.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source4/dsdb/samdb/ldb_modules/ranged_results.c b/source4/dsdb/samdb/ldb_modules/ranged_results.c
index 345b8b8440..c527afc6db 100644
--- a/source4/dsdb/samdb/ldb_modules/ranged_results.c
+++ b/source4/dsdb/samdb/ldb_modules/ranged_results.c
@@ -153,8 +153,10 @@ static int rr_search(struct ldb_module *module, struct ldb_request *req)
if (strncasecmp(p, ";range=", strlen(";range=")) != 0) {
continue;
}
- if (sscanf(p, ";range=%u-*", &start) == 1) {
- } else if (sscanf(p, ";range=%u-%u", &start, &end) != 2) {
+ if (sscanf(p, ";range=%u-%u", &start, &end) == 2) {
+ } else if (sscanf(p, ";range=%u-*", &start) == 1) {
+ end = (unsigned int)-1;
+ } else {
ldb_asprintf_errstring(module->ldb, "range request error: range requst malformed");
return LDB_ERR_UNWILLING_TO_PERFORM;
}