From a8ffcec127db17b25c9b1fd97b7494ffa06efe45 Mon Sep 17 00:00:00 2001 From: Andrea Mazzoleni Date: Sun, 16 Aug 2026 21:28:28 +0200 Subject: [PATCH] Accumulate ReadCount and WriteCount into 64-bit count in devstat --- cmdline/mingwapp.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmdline/mingwapp.c b/cmdline/mingwapp.c index e9c7c56c..dc2ab810 100644 --- a/cmdline/mingwapp.c +++ b/cmdline/mingwapp.c @@ -895,7 +895,9 @@ static int devstat(uint64_t device, const char* name, const char* wfile, uint64_ return -1; } - *count = ds.ReadCount + ds.WriteCount; + /* accumulate in 64-bit to avoid 32-bit overflow when adding the two DWORD counters */ + *count = ds.ReadCount; + *count += ds.WriteCount; return 0; }