diff options
author | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-08 13:37:14 -0400 |
---|---|---|
committer | Stephen Gallagher <sgallagh@redhat.com> | 2012-05-10 11:34:46 -0400 |
commit | ca4b7b92738f3dd463914e3de5757cd98d37a983 (patch) | |
tree | b7b781eabeed9a096fca59df8d836418ac3a41b7 /src/providers/ldap/ldap_common.c | |
parent | e2a59ba258ab98a6f50a1af627bc4cdceaa59101 (diff) | |
download | sssd-ca4b7b92738f3dd463914e3de5757cd98d37a983.tar.gz sssd-ca4b7b92738f3dd463914e3de5757cd98d37a983.tar.bz2 sssd-ca4b7b92738f3dd463914e3de5757cd98d37a983.zip |
LDAP: Add attr_count return value to build_attrs_from_map()
This is necessary because in several places in the code, we are
appending to the attrs returned from this value, and if we relied
on the map size macro, we would be appending after the NULL
terminator if one or more attributes were defined as NULL.
Diffstat (limited to 'src/providers/ldap/ldap_common.c')
-rw-r--r-- | src/providers/ldap/ldap_common.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/src/providers/ldap/ldap_common.c b/src/providers/ldap/ldap_common.c index 8e117d26..dd782815 100644 --- a/src/providers/ldap/ldap_common.c +++ b/src/providers/ldap/ldap_common.c @@ -1303,14 +1303,11 @@ errno_t list_missing_attrs(TALLOC_CTX *mem_ctx, return ENOMEM; } - ret = build_attrs_from_map(tmp_ctx, map, map_size, &expected_attrs); + ret = build_attrs_from_map(tmp_ctx, map, map_size, &expected_attrs, &attr_count); if (ret != EOK) { goto done; } - /* Count the expected attrs */ - while(expected_attrs[attr_count]) attr_count++; - /* Allocate the maximum possible values for missing_attrs, to * be on the safe side */ |