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

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