Swap (Windows): prevents integer overflow in swap size

Regression from 7ec0c664c5
This commit is contained in:
李通洲
2025-09-30 10:05:08 +08:00
parent 1594a69d6c
commit c10b652a2e
+2 -2
View File
@@ -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;
}