Zero libnet_LookupName out struct before using
authorSwen Schillig <swen@vnet.ibm.com>
Fri, 26 Jan 2018 12:28:58 +0000 (13:28 +0100)
committerChristof Schmitt <cs@samba.org>
Fri, 2 Mar 2018 18:13:52 +0000 (19:13 +0100)
Zero libnet_LookupName out struct before setting results,
preventing false result interpretation.

Signed-off-by: Swen Schillig <swen@vnet.ibm.com>
Reviewed-by: Ralph Boehme <slow@samba.org>
Reviewed-by: Christof Schmitt <cs@samba.org>
source4/libnet/libnet_lookup.c

index bdb999504939507c398b75fb447a58ecd4e2af47..a8d41f45335739676bda3a3b8f238032f74b9d22 100644 (file)
@@ -384,14 +384,11 @@ NTSTATUS libnet_LookupName_recv(struct composite_context *c, TALLOC_CTX *mem_ctx
        struct lookup_name_state *s;
 
        status = composite_wait(c);
+       ZERO_STRUCT(io->out);
 
        if (NT_STATUS_IS_OK(status)) {
                s = talloc_get_type(c->private_data, struct lookup_name_state);
 
-               io->out.rid = 0;
-               io->out.sid = NULL;
-               io->out.sidstr = NULL;
-
                if (*s->lookup.out.count > 0) {
                        struct lsa_RefDomainList *domains = *s->lookup.out.domains;
                        struct lsa_TransSidArray *sids = s->lookup.out.sids;