mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
Swap (Windows): fixes out-of-bound memory access when swaps are disabled
This commit is contained in:
@@ -14,6 +14,10 @@ const char* ffDetectSwap(FFlist* result) {
|
||||
return "NtQuerySystemInformation(SystemPagefileInformation, size) failed";
|
||||
}
|
||||
|
||||
if (size == 0) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
uint32_t pageSize = instance.state.platform.sysinfo.pageSize;
|
||||
for (SYSTEM_PAGEFILE_INFORMATION* current = pstart;; current = (SYSTEM_PAGEFILE_INFORMATION*) ((uint8_t*) current + current->NextEntryOffset)) {
|
||||
FFSwapResult* swap = ffListAdd(result);
|
||||
|
||||
Reference in New Issue
Block a user