Blame SOURCES/autofs-5.1.5-fix-hesiod-string-check-in-master_parse.patch

135b98
autofs-5.1.5 - fix hesiod string check in master_parse()
135b98
135b98
From: Ian Kent <raven@themaw.net>
135b98
135b98
When map source is specified in a master map entry, checking if
135b98
map type is hesiod in master_parse() will generate a SEGV if a
135b98
parser type is not also present becuase tmp will be NULL in this
135b98
case.
135b98
135b98
Signed-off-by: Ian Kent <raven@themaw.net>
135b98
---
135b98
 CHANGELOG          |    1 +
135b98
 lib/master_parse.y |    8 ++++----
135b98
 2 files changed, 5 insertions(+), 4 deletions(-)
135b98
135b98
--- autofs-5.1.4.orig/CHANGELOG
135b98
+++ autofs-5.1.4/CHANGELOG
135b98
@@ -37,6 +37,7 @@ xx/xx/2018 autofs-5.1.5
135b98
 - fix incorrect locking in sss lookup.
135b98
 - fix amd parser opts option handling.
135b98
 - better handle hesiod support not built in.
135b98
+- fix hesiod string check in master_parse().
135b98
 
135b98
 19/12/2017 autofs-5.1.4
135b98
 - fix spec file url.
135b98
--- autofs-5.1.4.orig/lib/master_parse.y
135b98
+++ autofs-5.1.4/lib/master_parse.y
135b98
@@ -172,8 +172,8 @@ line:
135b98
 		if ((tmp = strchr($2, ',')))
135b98
 			*tmp++ = '\0';
135b98
 #ifndef WITH_HESIOD
135b98
-		/* Map type or or map type parser is hesiod */
135b98
-		if (!strcmp($2, "hesiod") || !strcmp(tmp, "hesiod")) {
135b98
+		/* Map type or map type parser is hesiod */
135b98
+		if (!strcmp($2, "hesiod") || (tmp && !strcmp(tmp, "hesiod"))) {
135b98
 			master_error("hesiod support not built in");
135b98
 			local_free_vars();
135b98
 			YYABORT;
135b98
@@ -360,8 +360,8 @@ map:	PATH
135b98
 		if ((tmp = strchr($1, ',')))
135b98
 			*tmp++ = '\0';
135b98
 #ifndef WITH_HESIOD
135b98
-		/* Map type or or map type parser is hesiod */
135b98
-		if (!strcmp($1, "hesiod") || !strcmp(tmp, "hesiod")) {
135b98
+		/* Map type or map type parser is hesiod */
135b98
+		if (!strcmp($1, "hesiod") || (tmp && !strcmp(tmp, "hesiod"))) {
135b98
 			master_error("hesiod support not built in");
135b98
 			local_free_vars();
135b98
 			YYABORT;