summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2004-09-17 01:13:47 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 10:52:41 -0500
commitb0d376ba0764f8bf51cbaaaefc996a68d7b14420 (patch)
tree2743745bea0be66c4bcd464566c8fe73754b728f
parent40a89ce884de9de9cd013864e03a73b9c44ebde7 (diff)
downloadsamba-b0d376ba0764f8bf51cbaaaefc996a68d7b14420.tar.gz
samba-b0d376ba0764f8bf51cbaaaefc996a68d7b14420.tar.bz2
samba-b0d376ba0764f8bf51cbaaaefc996a68d7b14420.zip
r2374: Fix from Vince Brimhall vbrimhall@novell.com for
ldapsam_compat. Be robust against NULL attributes. Jeremy. (This used to be commit 727fc341b578577c112e97b0ef6f4c7f8bd15f66)
-rw-r--r--source3/passdb/pdb_ldap.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source3/passdb/pdb_ldap.c b/source3/passdb/pdb_ldap.c
index 9af34705df..4f9140d3a8 100644
--- a/source3/passdb/pdb_ldap.c
+++ b/source3/passdb/pdb_ldap.c
@@ -1229,8 +1229,13 @@ static void append_attr(char ***attr_list, const char *new_attr)
{
int i;
- for (i=0; (*attr_list)[i] != NULL; i++)
+ if (new_attr == NULL) {
+ return;
+ }
+
+ for (i=0; (*attr_list)[i] != NULL; i++) {
;
+ }
(*attr_list) = Realloc((*attr_list), sizeof(**attr_list) * (i+2));
SMB_ASSERT((*attr_list) != NULL);