* [Patch] fix parsing of statistics type-attribute
@ 2007-03-06 19:26 Martin Peschke
0 siblings, 0 replies; only message in thread
From: Martin Peschke @ 2007-03-06 19:26 UTC (permalink / raw)
To: Andrew Morton; +Cc: linux-kernel, linux-s390, Wu Fengguang
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@de.ibm.com>
---
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);
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2007-03-06 19:26 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-06 19:26 [Patch] fix parsing of statistics type-attribute Martin Peschke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox