projects
/
collectd.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
f519b4b
)
openldap: Fixed possible dereference of NULL pointer
author
Pavel Rochnyack
<pavel2000@ngs.ru>
Mon, 24 Jul 2017 07:05:16 +0000
(14:05 +0700)
committer
Pavel Rochnyack
<pavel2000@ngs.ru>
Mon, 24 Jul 2017 07:07:27 +0000
(14:07 +0700)
If `plugin_register_complex_read()` has failed, then `cldap_free` is called which set pointer to NULL.
That pointer is accessed by `cldap_shutdown()` callback later.
src/openldap.c
patch
|
blob
|
history
diff --git
a/src/openldap.c
b/src/openldap.c
index
b3fcb10
..
227c8e1
100644
(file)
--- a/
src/openldap.c
+++ b/
src/openldap.c
@@
-535,7
+535,7
@@
static int cldap_init(void) /* {{{ */
static int cldap_shutdown(void) /* {{{ */
{
for (size_t i = 0; i < databases_num; i++)
- if (databases[i]->ld != NULL)
+ if (databases[i]
!= NULL && databases[i]
->ld != NULL)
ldap_unbind_ext_s(databases[i]->ld, NULL, NULL);
sfree(databases);
databases_num = 0;