diff options
author | Lukas Slebodnik <lslebodn@redhat.com> | 2014-03-21 17:14:48 +0100 |
---|---|---|
committer | Jakub Hrozek <jhrozek@redhat.com> | 2014-04-04 14:14:03 +0200 |
commit | e18d5c703c529f99bd375da887d9aeaee6b82fcd (patch) | |
tree | 935ed7ebf0b260fa107bb8c58a71d12f35e954c3 /src/providers/ldap/sdap_async_autofs.c | |
parent | 8214510f125879c3b1d247f2ce981ee20b5375d1 (diff) | |
download | sssd-e18d5c703c529f99bd375da887d9aeaee6b82fcd.tar.gz sssd-e18d5c703c529f99bd375da887d9aeaee6b82fcd.tar.xz sssd-e18d5c703c529f99bd375da887d9aeaee6b82fcd.zip |
AUTOFS: terminate array after the last entry
If LDAP entries have more then one attribute "automountKey"
automount map will be skipped and error message will be printed to log files
and sssd_be will crash.
DEBUG(SSSDBG_MINOR_FAILURE, "Malformed entry, skipping\n");
The output array with automount maps will contain uninitialized pointers
because array was terminated after the expected count of entries and not
after the last successfully retrieved entry
Resolves:
https://fedorahosted.org/sssd/ticket/2288
Reviewed-by: Pavel Březina <pbrezina@redhat.com>
Diffstat (limited to 'src/providers/ldap/sdap_async_autofs.c')
-rw-r--r-- | src/providers/ldap/sdap_async_autofs.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/providers/ldap/sdap_async_autofs.c b/src/providers/ldap/sdap_async_autofs.c index 616a3b9a5..1db8d2067 100644 --- a/src/providers/ldap/sdap_async_autofs.c +++ b/src/providers/ldap/sdap_async_autofs.c @@ -844,7 +844,8 @@ sdap_autofs_setautomntent_save(struct tevent_req *req) j++; } - ldap_entrylist[state->entries_count] = NULL; + /* terminate array with NULL after the last retrieved entry */ + ldap_entrylist[j] = NULL; } ret = sysdb_autofs_entries_by_map(tmp_ctx, state->dom, state->mapname, |