summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/nsswitch/winbindd_ads.c6
-rw-r--r--source3/nsswitch/winbindd_cache.c3
-rw-r--r--source3/nsswitch/winbindd_cm.c3
-rw-r--r--source3/nsswitch/winbindd_misc.c5
4 files changed, 14 insertions, 3 deletions
diff --git a/source3/nsswitch/winbindd_ads.c b/source3/nsswitch/winbindd_ads.c
index 3ed651f8cd..250b5f3b8c 100644
--- a/source3/nsswitch/winbindd_ads.c
+++ b/source3/nsswitch/winbindd_ads.c
@@ -904,7 +904,11 @@ static NTSTATUS lookup_groupmem(struct winbindd_domain *domain,
members = NULL;
num_members = 0;
- attrs = TALLOC_ARRAY(mem_ctx, const char *, 3);
+ if ((attrs = TALLOC_ARRAY(mem_ctx, const char *, 3)) == NULL) {
+ status = NT_STATUS_NO_MEMORY;
+ goto done;
+ }
+
attrs[1] = talloc_strdup(mem_ctx, "usnChanged");
attrs[2] = NULL;
diff --git a/source3/nsswitch/winbindd_cache.c b/source3/nsswitch/winbindd_cache.c
index ba69d41392..e078c295e1 100644
--- a/source3/nsswitch/winbindd_cache.c
+++ b/source3/nsswitch/winbindd_cache.c
@@ -276,7 +276,7 @@ static BOOL centry_sid(struct cache_entry *centry, TALLOC_CTX *mem_ctx, DOM_SID
{
char *sid_string;
sid_string = centry_string(centry, mem_ctx);
- if (!string_to_sid(sid, sid_string)) {
+ if ((sid_string == NULL) || (!string_to_sid(sid, sid_string))) {
return False;
}
return True;
@@ -2136,6 +2136,7 @@ void wcache_flush_cache(void)
if (!wcache->tdb) {
DEBUG(0,("Failed to open winbindd_cache.tdb!\n"));
+ return;
}
tdb_traverse(wcache->tdb, traverse_fn_cleanup, NULL);
diff --git a/source3/nsswitch/winbindd_cm.c b/source3/nsswitch/winbindd_cm.c
index b24ed842de..ea4d8503c1 100644
--- a/source3/nsswitch/winbindd_cm.c
+++ b/source3/nsswitch/winbindd_cm.c
@@ -723,6 +723,9 @@ static BOOL find_new_dc(TALLOC_CTX *mem_ctx,
if ((num_dcnames == 0) || (num_dcnames != num_addrs))
return False;
+ if ((addrs == NULL) || (dcnames == NULL))
+ return False;
+
if ( !open_any_socket_out(addrs, num_addrs, 10000, &fd_index, fd) )
{
for (i=0; i<num_dcs; i++) {
diff --git a/source3/nsswitch/winbindd_misc.c b/source3/nsswitch/winbindd_misc.c
index 9413a79aba..6c6dc5b765 100644
--- a/source3/nsswitch/winbindd_misc.c
+++ b/source3/nsswitch/winbindd_misc.c
@@ -158,7 +158,10 @@ enum winbindd_result winbindd_dual_list_trusted_domains(struct winbindd_domain *
/* This is a bit excessive, but the extra data sooner or later will be
talloc'ed */
- extra_data_len = strlen(extra_data);
+ extra_data_len = 0;
+ if (extra_data != NULL) {
+ extra_data_len = strlen(extra_data);
+ }
if (extra_data_len > 0) {
state->response.extra_data.data = SMB_STRDUP(extra_data);