From e9cb93501216c891347481a032ac058cc3deea2b Mon Sep 17 00:00:00 2001 From: Tobias Klauser Date: Wed, 29 May 2013 13:06:22 +0200 Subject: ifpps: Properly zero out allocated stats The dynamically allocated members of struct ifstat have an entry for each CPU. Properly consider this when resetting the stats in the STATS_ZERO1 macro. Reported-by: Daniel Borkmann Signed-off-by: Tobias Klauser --- ifpps.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ifpps.c b/ifpps.c index 5e4b5b0..3dbb337 100644 --- a/ifpps.c +++ b/ifpps.c @@ -164,7 +164,7 @@ static void stats_alloc(struct ifstat *stats, int cpus) } #define STATS_ZERO1(member) \ - do { memset(stats->member, 0, sizeof(*(stats->member))); } while (0) + do { memset(stats->member, 0, cpus * sizeof(*(stats->member))); } while (0) static void stats_zero(struct ifstat *stats, int cpus) { -- cgit v1.2.3-54-g00ecf