From 9e4c7120e0b0c043ed1e968205793519f2cfcf63 Mon Sep 17 00:00:00 2001 From: Sebastien GODARD Date: Sun, 22 Sep 2019 18:25:24 +0200 Subject: [PATCH] iostat: Make sure structures are init'ed before using Fix CID#349503. Signed-off-by: Sebastien GODARD --- iostat.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/iostat.c b/iostat.c index 34c4a87..dc0eb08 100644 --- a/iostat.c +++ b/iostat.c @@ -1215,6 +1215,9 @@ void write_ext_stat(unsigned long long itv, int fctr, int hpart, struct ext_disk_stats xds; struct ext_io_stats xios; + memset(&xds, 0, sizeof(struct ext_disk_stats)); + memset(&xios, 0, sizeof(struct ext_io_stats)); + /* * Counters overflows are possible, but don't need to be handled in * a special way: The difference is still properly calculated if the -- 2.40.0