diff options
author | Gerald Carter <jerry@samba.org> | 2001-05-09 15:57:01 +0000 |
---|---|---|
committer | Gerald Carter <jerry@samba.org> | 2001-05-09 15:57:01 +0000 |
commit | 9f275b0f89d56521101725f6911ece66a022df93 (patch) | |
tree | f04e020a86f59ea3213429e7700e1e4603e04518 | |
parent | 5c6b3f0dea1b34dd5dc63a79fd315442b1b931b3 (diff) | |
download | samba-9f275b0f89d56521101725f6911ece66a022df93.tar.gz samba-9f275b0f89d56521101725f6911ece66a022df93.tar.xz samba-9f275b0f89d56521101725f6911ece66a022df93.zip |
check the number of domains returned to enum_trusted_domains
before allocating memory
-rw-r--r-- | source/libsmb/cli_lsarpc.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/source/libsmb/cli_lsarpc.c b/source/libsmb/cli_lsarpc.c index f60a0f960c9..4dd46aca8ee 100644 --- a/source/libsmb/cli_lsarpc.c +++ b/source/libsmb/cli_lsarpc.c @@ -529,14 +529,14 @@ uint32 cli_lsa_enum_trust_dom(struct cli_state *cli, TALLOC_CTX *mem_ctx, /* Return output parameters */ - if (!((*domain_names) = (char **)talloc(mem_ctx, sizeof(char *) * + if (r.num_domains && !((*domain_names) = (char **)talloc(mem_ctx, sizeof(char *) * r.num_domains))) { DEBUG(0, ("cli_lsa_enum_trust_dom(): out of memory\n")); result = NT_STATUS_UNSUCCESSFUL; goto done; } - if (!((*domain_sids) = (DOM_SID *)talloc(mem_ctx, sizeof(DOM_SID) * + if (r.num_domains && !((*domain_sids) = (DOM_SID *)talloc(mem_ctx, sizeof(DOM_SID) * r.num_domains))) { DEBUG(0, ("cli_lsa_enum_trust_dom(): out of memory\n")); result = NT_STATUS_UNSUCCESSFUL; |