Blame SOURCES/autofs-5.0.7-fix-parse-buffer-initialization.patch

304803
autofs-5.0.7 - fix parse buffer initialization
304803
304803
From: Ian Kent <ikent@redhat.com>
304803
304803
When parsing a master map entry, if the mount point path is longer than
304803
the following map string the lexical analyzer buffer may not have a null
304803
terminator where it is expected. If the map name string also contains a
304803
string that is the same as a map type at the end the map name the map
304803
name is not constructed correctly because of this lack of a string
304803
terminator in the buffer.
304803
---
304803
304803
 CHANGELOG        |    1 +
304803
 lib/master_tok.l |    4 +++-
304803
 2 files changed, 4 insertions(+), 1 deletions(-)
304803
304803
304803
diff --git a/CHANGELOG b/CHANGELOG
304803
index 34c70fa..276d6ba 100644
304803
--- a/CHANGELOG
304803
+++ b/CHANGELOG
304803
@@ -3,6 +3,7 @@
304803
 - fix nobind sun escaped map entries.
304803
 - fix use cache entry after free in lookup_prune_one_cache().
304803
 - fix ipv6 proximity calculation.
304803
+- fix parse buffer initialization.
304803
 
304803
 25/07/2012 autofs-5.0.7
304803
 =======================
304803
diff --git a/lib/master_tok.l b/lib/master_tok.l
304803
index 0d6edb7..30abb15 100644
304803
--- a/lib/master_tok.l
304803
+++ b/lib/master_tok.l
304803
@@ -74,7 +74,8 @@ int my_yyinput(char *, int);
304803
 #define unput(c) (*(char *) --line = c)
304803
 #endif
304803
 
304803
-char buff[1024];
304803
+#define BUFF_LEN	1024
304803
+char buff[BUFF_LEN];
304803
 char *bptr;
304803
 char *optr = buff;
304803
 unsigned int tlen;
304803
@@ -174,6 +175,7 @@ OPTNTOUT	(-n{OPTWS}|-n{OPTWS}={OPTWS}|--negative-timeout{OPTWS}|--negative-timeo
304803
 		*bptr = '\0';
304803
 		strcpy(master_lval.strtype, buff);
304803
 		bptr = buff;
304803
+		memset(buff, 0, BUFF_LEN);
304803
 		return(PATH);
304803
 	}
304803