From: Evan Hunt Date: Sat, 14 Dec 2013 19:05:58 +0000 (-0800) Subject: [master] fix null deref in some DLZ modules X-Git-Tag: v9.10.0a2~160 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=5f8d6cec48cef9055359c628942d633693f732b2;p=thirdparty%2Fbind9.git [master] fix null deref in some DLZ modules 3691. [contrib] Address null pointer dereference in LDAP and MySQL DLZ modules. --- diff --git a/CHANGES b/CHANGES index 75828ade810..82919648d63 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 3c67172f06b..977892ac7ed 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 5227baf1be7..e2bff75ef6e 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 */