summaryrefslogtreecommitdiff
path: root/source3/winbindd
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2012-04-28 19:51:46 +0200
committerVolker Lendecke <vl@samba.org>2012-04-28 22:04:14 +0200
commit4a28c6ca7cd97535596dd93741689ff17bb1c395 (patch)
tree2735ec2d2cb403ee49ae591683e02b9f7162fcdd /source3/winbindd
parent0dc3f423d25d3a50fa39ecee8a8ca13cdfe32267 (diff)
downloadsamba-4a28c6ca7cd97535596dd93741689ff17bb1c395.tar.gz
samba-4a28c6ca7cd97535596dd93741689ff17bb1c395.tar.bz2
samba-4a28c6ca7cd97535596dd93741689ff17bb1c395.zip
s3: Fix bug 8904 -- wbinfo --lookup-sids "" crashes winbind
Much of the code further down and up the call chain expects the structures wb_lookupsids returns to be allocated. Do that despite we have nothing to look up.
Diffstat (limited to 'source3/winbindd')
-rw-r--r--source3/winbindd/wb_lookupsids.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/source3/winbindd/wb_lookupsids.c b/source3/winbindd/wb_lookupsids.c
index e896860e01..ae815ce067 100644
--- a/source3/winbindd/wb_lookupsids.c
+++ b/source3/winbindd/wb_lookupsids.c
@@ -123,11 +123,6 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
state->sids = sids;
state->num_sids = num_sids;
- if (num_sids == 0) {
- tevent_req_done(req);
- return tevent_req_post(req, ev);
- }
-
state->single_sids = talloc_array(state, uint32_t, num_sids);
if (tevent_req_nomem(state->single_sids, req)) {
return tevent_req_post(req, ev);
@@ -153,6 +148,11 @@ struct tevent_req *wb_lookupsids_send(TALLOC_CTX *mem_ctx,
return tevent_req_post(req, ev);
}
+ if (num_sids == 0) {
+ tevent_req_done(req);
+ return tevent_req_post(req, ev);
+ }
+
for (i=0; i<num_sids; i++) {
struct wb_lookupsids_domain *d;