sysfsutils/0006-limit-cdev-name-length-comparsion.patch
Christopher Engelhard c1dfc3ce6e Use new upstream tarball, backport relevant upstream fixes up to commit b688c65
The new tarball hosted on GitHub is not identical to the original one, but
contains no functional differences

All of Fedora's patches to sysfsutils 2.1.0 have been merged upstream and will
be included in the next sysfsutils release. This commit incorporates all previous
patches. Additionally, it backports various fixes added upstream, that mainly
deal with compiler warnings when using moden compilers.
2020-08-17 18:34:42 +02:00

31 lines
923 B
Diff

From 34df9af8e15e331f45c3a453852d5a24486744ed Mon Sep 17 00:00:00 2001
From: Lee Duncan <lduncan@suse.com>
Date: Wed, 8 Jul 2020 11:17:18 -0700
Subject: [PATCH 6/8] Limit cdev name length comparsion to strlen()+1
In commit 270af678d4241306 cdev_name_equal() was updated
so that "eth1" and "eth10" did not match, but the limit
on the length of the compare was too large, as we know
the length of both strings. This is just a cleanup, and
should cause no functional change.
---
lib/sysfs_class.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/sysfs_class.c b/lib/sysfs_class.c
index c696ff0..fcaa488 100644
--- a/lib/sysfs_class.c
+++ b/lib/sysfs_class.c
@@ -83,7 +83,7 @@ static int cdev_name_equal(void *a, void *b)
if (length_a != length_b)
return 0;
- if (strncmp(str_a, str_b, SYSFS_NAME_LEN+1) == 0)
+ if (strncmp(str_a, str_b, length_a+1) == 0)
return 1;
return 0;
--
2.28.0