1
0
mirror of https://github.com/samba-team/samba.git synced 2024-12-25 23:21:54 +03:00

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 commit is contained in:
Andrew Bartlett 2008-01-23 08:57:16 +11:00
parent b99b604a5f
commit 669f137f0e

View File

@ -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;
}