summaryrefslogtreecommitdiffstats
path: root/source3/winbindd/wb_sids2xids.c
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2015-03-05 20:59:16 +0100
committerVolker Lendecke <vl@samba.org>2015-03-07 15:28:59 +0100
commit5ba377f3df61647e259d40a6fa24dc8445618cda (patch)
tree502687a456fd99015041a1225665035db6a85536 /source3/winbindd/wb_sids2xids.c
parent91ff65b2f63061fa66b6bcc3c142c17b03581759 (diff)
downloadsamba-5ba377f3df61647e259d40a6fa24dc8445618cda.tar.gz
samba-5ba377f3df61647e259d40a6fa24dc8445618cda.tar.xz
samba-5ba377f3df61647e259d40a6fa24dc8445618cda.zip
winbind: Make wb_sids2xids_recv work on an array
The trigger for this is that Coverity got confused by the dual use of &xid as an array with the implicit length equality between wb_sids2xids_send and the array passed in to wb_sids2xids_recv for the result. I don't want to start doing things just for the Coverity scan, but this makes the code clearer to me by removing this implicit expected array length equality. Signed-off-by: Volker Lendecke <vl@samba.org> Signed-off-by: David Disseldorp <ddiss@samba.org> Reviewed-by: Volker Lendecke <vl@samba.org> Reviewed-by: David Disseldorp <ddiss@samba.org> Autobuild-User(master): Volker Lendecke <vl@samba.org> Autobuild-Date(master): Sat Mar 7 15:28:59 CET 2015 on sn-devel-104
Diffstat (limited to 'source3/winbindd/wb_sids2xids.c')
-rw-r--r--source3/winbindd/wb_sids2xids.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/source3/winbindd/wb_sids2xids.c b/source3/winbindd/wb_sids2xids.c
index 76149743f0..e3962de269 100644
--- a/source3/winbindd/wb_sids2xids.c
+++ b/source3/winbindd/wb_sids2xids.c
@@ -253,7 +253,7 @@ static void wb_sids2xids_done(struct tevent_req *subreq)
}
NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
- struct unixid *xids)
+ struct unixid xids[], uint32_t num_xids)
{
struct wb_sids2xids_state *state = tevent_req_data(
req, struct wb_sids2xids_state);
@@ -265,6 +265,12 @@ NTSTATUS wb_sids2xids_recv(struct tevent_req *req,
return status;
}
+ if (num_xids != state->num_sids) {
+ DEBUG(1, ("%s: Have %u xids, caller wants %u\n", __func__,
+ (unsigned)state->num_sids, num_xids));
+ return NT_STATUS_INTERNAL_ERROR;
+ }
+
num_non_cached = 0;
for (i=0; i<state->num_sids; i++) {