Blob Blame History Raw
autofs-5.1.0 - init qdn before use in get_query_dn()

From: Ian Kent <ikent@redhat.com>

Ensure qdn is initialized before use in case there's garbage in it.
---
 CHANGELOG             |    1 +
 modules/lookup_ldap.c |    2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/CHANGELOG b/CHANGELOG
index 9e2dc89..7c0a7bb 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -34,6 +34,7 @@
 - gaurd against incorrect umount return.
 - update man page autofs(8) for systemd.
 - fix fix master map type check.
+- init qdn before use in get_query_dn().
 
 04/06/2014 autofs-5.1.0
 =======================
diff --git a/modules/lookup_ldap.c b/modules/lookup_ldap.c
index ac2ef30..5da613e 100644
--- a/modules/lookup_ldap.c
+++ b/modules/lookup_ldap.c
@@ -335,7 +335,7 @@ LDAP *init_ldap_connection(unsigned logopt, const char *uri, struct lookup_conte
 static int get_query_dn(unsigned logopt, LDAP *ldap, struct lookup_context *ctxt, const char *class, const char *key)
 {
 	char buf[MAX_ERR_BUF];
-	char *query, *dn, *qdn;
+	char *query, *dn, *qdn = NULL;
 	LDAPMessage *result = NULL, *e;
 	char *attrs[2];
 	struct berval **value;