diff options
author | Andreas Schneider <asn@samba.org> | 2013-11-07 15:57:51 +0100 |
---|---|---|
committer | Andreas Schneider <asn@samba.org> | 2013-11-07 17:02:55 +0100 |
commit | 8ef055bad502f59ee1243303637a5a5fe6dc0d5b (patch) | |
tree | ef2fa6071e5c1bdd04cbc5ce53441e5bbf79f347 /source4/rpc_server | |
parent | 0aa73958f0679f8b7389295c4601903f3f8f3a53 (diff) | |
download | samba-8ef055bad502f59ee1243303637a5a5fe6dc0d5b.tar.gz |
s4-lsa: Add missing null checks in dcesrv_lsa_lookup_name().
Signed-off-by: Andreas Schneider <asn@samba.org>
Reviewed-by: Volker Lendecke <vl@samba.org>
Diffstat (limited to 'source4/rpc_server')
-rw-r--r-- | source4/rpc_server/lsa/lsa_lookup.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source4/rpc_server/lsa/lsa_lookup.c b/source4/rpc_server/lsa/lsa_lookup.c index 40842f02bd0..daf571987c9 100644 --- a/source4/rpc_server/lsa/lsa_lookup.c +++ b/source4/rpc_server/lsa/lsa_lookup.c @@ -284,6 +284,9 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx, if (username == NULL) { *authority_name = NAME_BUILTIN; *sid = dom_sid_parse_talloc(mem_ctx, SID_BUILTIN); + if (*sid == NULL) { + return NT_STATUS_NO_MEMORY; + } *rtype = SID_NAME_DOMAIN; *rid = 0xFFFFFFFF; return NT_STATUS_OK; @@ -292,6 +295,9 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx, if (strcasecmp_m(username, NAME_NT_AUTHORITY) == 0) { *authority_name = NAME_NT_AUTHORITY; *sid = dom_sid_parse_talloc(mem_ctx, SID_NT_AUTHORITY); + if (*sid == NULL) { + return NT_STATUS_NO_MEMORY; + } *rtype = SID_NAME_DOMAIN; dom_sid_split_rid(NULL, *sid, NULL, rid); return NT_STATUS_OK; @@ -299,6 +305,9 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx, if (strcasecmp_m(username, NAME_BUILTIN) == 0) { *authority_name = NAME_BUILTIN; *sid = dom_sid_parse_talloc(mem_ctx, SID_BUILTIN); + if (*sid == NULL) { + return NT_STATUS_NO_MEMORY; + } *rtype = SID_NAME_DOMAIN; *rid = 0xFFFFFFFF; return NT_STATUS_OK; @@ -359,6 +368,9 @@ static NTSTATUS dcesrv_lsa_lookup_name(struct tevent_context *ev_ctx, if (!*username) { *authority_name = NAME_NT_AUTHORITY; *sid = dom_sid_parse_talloc(mem_ctx, SID_NT_AUTHORITY); + if (*sid == NULL) { + return NT_STATUS_NO_MEMORY; + } *rtype = SID_NAME_DOMAIN; dom_sid_split_rid(NULL, *sid, NULL, rid); return NT_STATUS_OK; |