]> granicus.if.org Git - sysstat/commitdiff
iostat: Make sure structures are init'ed before using
authorSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 22 Sep 2019 16:25:24 +0000 (18:25 +0200)
committerSebastien GODARD <sysstat@users.noreply.github.com>
Sun, 22 Sep 2019 16:25:24 +0000 (18:25 +0200)
Fix CID#349503.

Signed-off-by: Sebastien GODARD <sysstat@users.noreply.github.com>
iostat.c

index 34c4a87faf6b923a0873ead27445855b7671e637..dc0eb0855ba6f924d91ecf40d402a4c48d92c4ec 100644 (file)
--- 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