autofs-5.0.9 - fix reset flex scan buffer on init

From: Ian Kent <ikent@redhat.com>

If a scan results in an error the flex scan buffer is sometimes
not properly reset for the next scan.

This can result in an incorrect success return for a subsequent
operation, such as a map re-read, for a master map line that's
actually incorrect. Given the success return autofs tries to add
a master map entry that doesn't have the needed information, such
as the mount path, and a SEGV results.
---
 CHANGELOG        |    1 +
 lib/master_tok.l |    2 ++
 2 files changed, 3 insertions(+)

diff --git a/CHANGELOG b/CHANGELOG
index 8d0d56c..8cdee0a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -3,6 +3,7 @@
 - fix mistake in assignment.
 - add amd map format parser.
 - check for non existent negative entries in lookup_ghost().
+- fix reset flex scan buffer on init.
 
 28/03/2014 autofs-5.0.9
 =======================
diff --git a/lib/master_tok.l b/lib/master_tok.l
index 9ba53f6..835c71d 100644
--- a/lib/master_tok.l
+++ b/lib/master_tok.l
@@ -439,6 +439,8 @@ void master_set_scan_buffer(const char *buffer)
 	memset(buff, 0, sizeof(buff));
 	optr = buff;
 
+	YY_FLUSH_BUFFER;
+
 	line = buffer;
 	line_pos = &line[0];
 	/*