Blame SOURCES/autofs-5.0.7-add-null-check-in-extract_version.patch

4d476f
autofs-5.0.7 - add null check in extract_version()
4d476f
4d476f
From: Ian Kent <raven@themaw.net>
4d476f
4d476f
A space should always be found in the passed in string but a check
4d476f
should be done in case it isn't.
4d476f
---
4d476f
 lib/mounts.c |    2 ++
4d476f
 1 file changed, 2 insertions(+)
4d476f
4d476f
diff --git a/lib/mounts.c b/lib/mounts.c
4d476f
index 0caa0aa..7b959b8 100644
4d476f
--- a/lib/mounts.c
4d476f
+++ b/lib/mounts.c
4d476f
@@ -168,6 +168,8 @@ unsigned int get_kver_minor(void)
4d476f
 static int extract_version(char *start, struct nfs_mount_vers *vers)
4d476f
 {
4d476f
 	char *s_ver = strchr(start, ' ');
4d476f
+	if (!s_ver)
4d476f
+		return 0;
4d476f
 	while (*s_ver && !isdigit(*s_ver)) {
4d476f
 		s_ver++;
4d476f
 		if (!*s_ver)