Blame SOURCES/autofs-5.0.9-fix-reset-flex-scan-buffer-on-init.patch

306fa1
autofs-5.0.9 - fix reset flex scan buffer on init
306fa1
306fa1
From: Ian Kent <ikent@redhat.com>
306fa1
306fa1
If a scan results in an error the flex scan buffer is sometimes
306fa1
not properly reset for the next scan.
306fa1
306fa1
This can result in an incorrect success return for a subsequent
306fa1
operation, such as a map re-read, for a master map line that's
306fa1
actually incorrect. Given the success return autofs tries to add
306fa1
a master map entry that doesn't have the needed information, such
306fa1
as the mount path, and a SEGV results.
306fa1
---
306fa1
 CHANGELOG        |    1 +
306fa1
 lib/master_tok.l |    2 ++
306fa1
 2 files changed, 3 insertions(+)
306fa1
306fa1
--- autofs-5.0.7.orig/CHANGELOG
306fa1
+++ autofs-5.0.7/CHANGELOG
306fa1
@@ -328,6 +328,7 @@
306fa1
 - improve hostname lookup error logging.
306fa1
 - allow period following macro in selector value.
306fa1
 - fix macro expansion in selector values.
306fa1
+- fix reset flex scan buffer on init.
306fa1
 
306fa1
 25/07/2012 autofs-5.0.7
306fa1
 =======================
306fa1
--- autofs-5.0.7.orig/lib/master_tok.l
306fa1
+++ autofs-5.0.7/lib/master_tok.l
306fa1
@@ -448,6 +448,8 @@ void master_set_scan_buffer(const char *
306fa1
 	memset(buff, 0, sizeof(buff));
306fa1
 	optr = buff;
306fa1
 
306fa1
+	YY_FLUSH_BUFFER;
306fa1
+
306fa1
 	line = buffer;
306fa1
 	line_pos = &line[0];
306fa1
 	/*