summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source3/libads/ldap.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/source3/libads/ldap.c b/source3/libads/ldap.c
index 7fb5dac51b..be15643ba2 100644
--- a/source3/libads/ldap.c
+++ b/source3/libads/ldap.c
@@ -1956,8 +1956,10 @@ char **ads_pull_strings_range(ADS_STRUCT *ads,
return NULL;
}
- memcpy(&strings[*num_strings], new_strings,
- sizeof(*new_strings) * num_new_strings);
+ if (new_strings && num_new_strings) {
+ memcpy(&strings[*num_strings], new_strings,
+ sizeof(*new_strings) * num_new_strings);
+ }
(*num_strings) += num_new_strings;