From 93aa12ef1f56a959b07c138a2e789381d0493bf4 Mon Sep 17 00:00:00 2001
From: Armin Luntzer <armin.luntzer@univie.ac.at>
Date: Thu, 19 Sep 2019 15:44:35 +0200
Subject: [PATCH] sysctl: limit comparison to strlen of object name in
 sysset_find_obj()

---
 lib/sysctl.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/sysctl.c b/lib/sysctl.c
index 9c5a0db..14bda23 100644
--- a/lib/sysctl.c
+++ b/lib/sysctl.c
@@ -512,7 +512,7 @@ struct sysobj *sysset_find_obj(struct sysset *sysset, const char *path)
 			if (!sysobj_name(s))
 				return ret;
 
-			if (strcmp(sysobj_name(s), token))
+			if (strncmp(sysobj_name(s), token, strlen(sysobj_name(s))))
 				continue;
 
 			if (!s->child)
-- 
GitLab