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

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