[Patch] fix parsing of statistics type-attribute

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this fix the the statistics user interface accepted, for example:

	echo name=my_stats type=utilisa > definition

while it should only accept:

	echo name=my_stats type=utilisation > definition


Signed-off-by: Martin Peschke <mp3@xxxxxxxxxx>
---

 statistic.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

Index: linux/lib/statistic.c
===================================================================
--- linux.orig/lib/statistic.c
+++ linux/lib/statistic.c
@@ -506,7 +506,8 @@ static int statistic_parse_match(struct 
 		len = (args[0].to - args[0].from);
 		for (type = 0; type < STAT_NONE; type++) {
 			disc = &statistic_discs[type];
-			if (unlikely(strncmp(disc->name, args[0].from, len)))
+			if (strlen(disc->name) != len ||
+			    strncmp(disc->name, args[0].from, len))
 				continue;
 			return statistic_parse_single(stat, info, def, type);
 		}


-
To unsubscribe from this list: send the line "unsubscribe linux-s390" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Kernel Development]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Info]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Linux Media]     [Device Mapper]

  Powered by Linux