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

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