From c10b652a2e3933b0cc69f4f31ec4e99329816428 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Tue, 30 Sep 2025 10:05:08 +0800 Subject: [PATCH] Swap (Windows): prevents integer overflow in swap size Regression from 7ec0c664c541063dade5280c9e0efdde5ed6bdcf --- src/detection/swap/swap_windows.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/detection/swap/swap_windows.c b/src/detection/swap/swap_windows.c index 26be6d204..ad4965836 100644 --- a/src/detection/swap/swap_windows.c +++ b/src/detection/swap/swap_windows.c @@ -21,8 +21,8 @@ const char* ffDetectSwap(FFlist* result) ffStrbufInitNWS(&swap->name, current->FileName.Length / sizeof(wchar_t), current->FileName.Buffer); if (ffStrbufStartsWithS(&swap->name, "\\??\\")) ffStrbufSubstrAfter(&swap->name, strlen("\\??\\") - 1); - swap->bytesUsed = current->TotalUsed * pageSize; - swap->bytesTotal = current->CurrentSize * pageSize; + swap->bytesUsed = (uint64_t) current->TotalUsed * pageSize; + swap->bytesTotal = (uint64_t) current->CurrentSize * pageSize; if (current->NextEntryOffset == 0) break; }