1
0
mirror of https://github.com/samba-team/samba.git synced 2025-08-02 00:22:11 +03:00

s3/rpc_client: fix handling of NT_STATUS_SOME_NOT_MAPPED

In this case names that couldn't be resolved will be have a NULL sid pointer
which would trigger a crash in sid_copy().

Pair-Programmed-With: Stefan Metzmacher <metze@samba.org>
Signed-off-by: Ralph Boehme <slow@samba.org>
Signed-off-by: Stefan Metzmacher <metze@samba.org>
This commit is contained in:
Ralph Boehme
2024-03-06 14:23:45 +01:00
committed by Stefan Metzmacher
parent 148a102800
commit 02da9704a0

View File

@ -751,12 +751,23 @@ NTSTATUS dcerpc_lsa_lookup_names_generic(struct dcerpc_binding_handle *h,
}
if (use_lookupnames4) {
sid_copy(sid, sid_array3.sids[i].sid);
if (sid_array3.sids[i].sid != NULL) {
sid_copy(sid, sid_array3.sids[i].sid);
} else {
ZERO_STRUCTP(sid);
(*types)[i] = SID_NAME_UNKNOWN;
}
} else {
sid_copy(sid, domains->domains[dom_idx].sid);
if (domains->domains[dom_idx].sid != NULL) {
sid_copy(sid, domains->domains[dom_idx].sid);
if (sid_array.sids[i].rid != 0xffffffff) {
sid_append_rid(sid, sid_array.sids[i].rid);
if (sid_array.sids[i].rid != 0xffffffff) {
sid_append_rid(sid,
sid_array.sids[i].rid);
}
} else {
ZERO_STRUCTP(sid);
(*types)[i] = SID_NAME_UNKNOWN;
}
}