Skip to content

Commit c10b652

Browse files
committed
Swap (Windows): prevents integer overflow in swap size
Regression from 7ec0c66
1 parent 1594a69 commit c10b652

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/detection/swap/swap_windows.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@ const char* ffDetectSwap(FFlist* result)
2121
ffStrbufInitNWS(&swap->name, current->FileName.Length / sizeof(wchar_t), current->FileName.Buffer);
2222
if (ffStrbufStartsWithS(&swap->name, "\\??\\"))
2323
ffStrbufSubstrAfter(&swap->name, strlen("\\??\\") - 1);
24-
swap->bytesUsed = current->TotalUsed * pageSize;
25-
swap->bytesTotal = current->CurrentSize * pageSize;
24+
swap->bytesUsed = (uint64_t) current->TotalUsed * pageSize;
25+
swap->bytesTotal = (uint64_t) current->CurrentSize * pageSize;
2626
if (current->NextEntryOffset == 0)
2727
break;
2828
}

0 commit comments

Comments
 (0)