diff options
author | Jeremy Allison <jra@samba.org> | 2007-05-04 22:01:26 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 12:19:54 -0500 |
commit | f1d8c4da23049cf0115666f8d97dac251395de76 (patch) | |
tree | c230d4f8c2b27fefd2e612fb2392388102233111 /source3/nsswitch | |
parent | 32b9beb164a419b97f00811dbc7a0fb57e086690 (diff) | |
download | samba-f1d8c4da23049cf0115666f8d97dac251395de76.tar.gz samba-f1d8c4da23049cf0115666f8d97dac251395de76.tar.bz2 samba-f1d8c4da23049cf0115666f8d97dac251395de76.zip |
r22675: Simo's patch for 0 size allocation. Still need
to examine parse_misc.c fix.
Jeremy.
(This used to be commit 80d981265cd3bc9d73c5da3c514ec736e2dfa73a)
Diffstat (limited to 'source3/nsswitch')
-rw-r--r-- | source3/nsswitch/idmap.c | 17 | ||||
-rw-r--r-- | source3/nsswitch/winbindd_async.c | 5 |
2 files changed, 13 insertions, 9 deletions
diff --git a/source3/nsswitch/idmap.c b/source3/nsswitch/idmap.c index 5222eba8f3..73a30f6087 100644 --- a/source3/nsswitch/idmap.c +++ b/source3/nsswitch/idmap.c @@ -1025,17 +1025,16 @@ static NTSTATUS idmap_backends_sids_to_unixids(struct id_map **ids) DEBUG(10, ("Query backends to map sids->ids\n")); /* split list per domain */ - - if (num_domains) { - dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains); - IDMAP_CHECK_ALLOC(dom_ids); - counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains); - IDMAP_CHECK_ALLOC(counters); - } else { - dom_ids = NULL; - counters = NULL; + if (num_domains == 0) { + DEBUG(1, ("No domains available?\n")); + return NT_STATUS_UNSUCCESSFUL; } + dom_ids = TALLOC_ZERO_ARRAY(ctx, struct id_map **, num_domains); + IDMAP_CHECK_ALLOC(dom_ids); + counters = TALLOC_ZERO_ARRAY(ctx, int, num_domains); + IDMAP_CHECK_ALLOC(counters); + /* partition the requests by domain */ for (i = 0; ids[i]; i++) { diff --git a/source3/nsswitch/winbindd_async.c b/source3/nsswitch/winbindd_async.c index a8a92c3cae..393479c63d 100644 --- a/source3/nsswitch/winbindd_async.c +++ b/source3/nsswitch/winbindd_async.c @@ -273,6 +273,11 @@ enum winbindd_result winbindd_dual_sids2xids(struct winbindd_domain *domain, DEBUG(3, ("[%5lu]: sids to unix ids\n", (unsigned long)state->pid)); + if (state->request.extra_len == 0) { + DEBUG(0, ("Invalid buffer size!\n")); + return WINBINDD_ERROR; + } + sids = (DOM_SID *)state->request.extra_data.data; num = state->request.extra_len / sizeof(DOM_SID); |