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

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