From b0d376ba0764f8bf51cbaaaefc996a68d7b14420 Mon Sep 17 00:00:00 2001 From: Jeremy Allison Date: Fri, 17 Sep 2004 01:13:47 +0000 Subject: r2374: Fix from Vince Brimhall vbrimhall@novell.com for ldapsam_compat. Be robust against NULL attributes. Jeremy. (This used to be commit 727fc341b578577c112e97b0ef6f4c7f8bd15f66) --- source3/passdb/pdb_ldap.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'source3/passdb') 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); -- cgit