From 5f8d6cec48cef9055359c628942d633693f732b2 Mon Sep 17 00:00:00 2001 From: Evan Hunt Date: Sat, 14 Dec 2013 11:05:58 -0800 Subject: [PATCH] [master] fix null deref in some DLZ modules 3691. [contrib] Address null pointer dereference in LDAP and MySQL DLZ modules. --- CHANGES | 3 +++ contrib/dlz/modules/ldap/dlz_ldap_dynamic.c | 3 ++- contrib/dlz/modules/mysql/dlz_mysql_dynamic.c | 3 ++- 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGES b/CHANGES index 75828ade81..82919648d6 100644 --- a/CHANGES +++ b/CHANGES @@ -1,3 +1,6 @@ +3691. [contrib] Address null pointer dereference in LDAP and + MySQL DLZ modules. + 3690. [bug] Iterative responses could be missed when the source port for an upstream query was the same as the listener port (53). [RT #34925] diff --git a/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c b/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c index 3c67172f06..977892ac7e 100644 --- a/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c +++ b/contrib/dlz/modules/ldap/dlz_ldap_dynamic.c @@ -1178,7 +1178,8 @@ dlz_destroy(void *dbdata) { ldap_instance_t *db = (ldap_instance_t *)dbdata; #if PTHREADS /* cleanup the list of DBI's */ - ldap_destroy_dblist((db_list_t *)(db->db)); + if (db->db != NULL) + ldap_destroy_dblist((db_list_t *)(db->db)); #else /* PTHREADS */ if (db->db->dbconn != NULL) ldap_unbind_s((LDAP *)(db->db->dbconn)); diff --git a/contrib/dlz/modules/mysql/dlz_mysql_dynamic.c b/contrib/dlz/modules/mysql/dlz_mysql_dynamic.c index 5227baf1be..e2bff75ef6 100644 --- a/contrib/dlz/modules/mysql/dlz_mysql_dynamic.c +++ b/contrib/dlz/modules/mysql/dlz_mysql_dynamic.c @@ -1069,7 +1069,8 @@ dlz_destroy(void *dbdata) { mysql_instance_t *db = (mysql_instance_t *)dbdata; #if PTHREADS /* cleanup the list of DBI's */ - mysql_destroy_dblist((db_list_t *)(db->db)); + if (db->db != NULL) + mysql_destroy_dblist((db_list_t *)(db->db)); #else /* PTHREADS */ mysql_destroy(db); #endif /* PTHREADS */