stats: fix io_u_plat out-of-bound accesses (round 2)
[fio.git] / stat.c
diff --git a/stat.c b/stat.c
index ee6ee51ec1553550322f0e8e9377b069127427ce..ae3c71af694cbd1771e556bb674c1065536146ad 100644 (file)
--- a/stat.c
+++ b/stat.c
@@ -773,11 +773,12 @@ void show_run_stats(void)
 
 
                for (k = 0; k <= 2; k++) {
-                       int m;
-
                        ts->total_io_u[k] += td->ts.total_io_u[k];
                        ts->short_io_u[k] += td->ts.short_io_u[k];
+               }
 
+               for (k = 0; k <= DDIR_WRITE; k++) {
+                       int m;
                        for (m = 0; m < FIO_IO_U_PLAT_NR; m++)
                                ts->io_u_plat[k][m] += td->ts.io_u_plat[k][m];
                }