summaryrefslogtreecommitdiff
path: root/source4/dsdb
diff options
context:
space:
mode:
Diffstat (limited to 'source4/dsdb')
-rw-r--r--source4/dsdb/kcc/kcc_connection.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source4/dsdb/kcc/kcc_connection.c b/source4/dsdb/kcc/kcc_connection.c
index ee9a05a21e..73198040c4 100644
--- a/source4/dsdb/kcc/kcc_connection.c
+++ b/source4/dsdb/kcc/kcc_connection.c
@@ -133,7 +133,7 @@ void kccsrv_apply_connections(struct kccsrv_service *s,
{
int i, j, deleted = 0, added = 0, ret;
- for (i = 0; i < ntds_list->count; i++) {
+ for (i = 0; ntds_list && i < ntds_list->count; i++) {
struct kcc_connection *ntds = &ntds_list->servers[i];
for (j = 0; j < dsa_list->count; j++) {
struct kcc_connection *dsa = &dsa_list->servers[j];
@@ -152,13 +152,13 @@ void kccsrv_apply_connections(struct kccsrv_service *s,
for (i = 0; i < dsa_list->count; i++) {
struct kcc_connection *dsa = &dsa_list->servers[i];
- for (j = 0; j < ntds_list->count; j++) {
+ for (j = 0; ntds_list && j < ntds_list->count; j++) {
struct kcc_connection *ntds = &ntds_list->servers[j];
if (GUID_equal(&dsa->dsa_guid, &ntds->dsa_guid)) {
break;
}
}
- if (j == ntds_list->count) {
+ if (ntds_list == NULL || j == ntds_list->count) {
ret = kccsrv_add_connection(s, dsa);
if (ret == LDB_SUCCESS) {
added++;