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

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