Blame SOURCES/autofs-5.1.0-check-host-macro-is-set-before-use.patch

306fa1
autofs-5.1.0 - check host macro is set before use
306fa1
306fa1
From: Ian Kent <ikent@redhat.com>
306fa1
306fa1
Check marco lookup return for ${host} in match_my_name() before using it.
306fa1
---
306fa1
 CHANGELOG           |    1 +
306fa1
 modules/parse_amd.c |    5 +++++
306fa1
 2 files changed, 6 insertions(+)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -140,6 +140,7 @@
306fa1
 - fix buffer size checks in merge_options().
306fa1
 - check amd lex buffer len before copy.
306fa1
 - add return check in ldap check_map_indirect().
306fa1
+- check host macro is set before use.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/modules/parse_amd.c
306fa1
+++ autofs-5.0.7/modules/parse_amd.c
306fa1
@@ -238,6 +238,11 @@ static int match_my_name(unsigned int lo
306fa1
 			return 1;
306fa1
 	}
306fa1
 
306fa1
+	if (!v || !v->val) {
306fa1
+		error(logopt, "error: ${host} not set");
306fa1
+		goto out;
306fa1
+	}
306fa1
+
306fa1
 	/* Check if comparison value is an alias */
306fa1
 
306fa1
 	memset(&hints, 0, sizeof(hints));