use physical memory in kib to avoid overflow of size_t (issue #1010)
This commit is contained in:
@@ -154,7 +154,7 @@ void _mi_prim_mem_init( mi_os_mem_config_t* config )
|
||||
if (pGetPhysicallyInstalledSystemMemory != NULL) {
|
||||
ULONGLONG memInKiB = 0;
|
||||
if ((*pGetPhysicallyInstalledSystemMemory)(&memInKiB)) {
|
||||
if (memInKiB > 0 && memInKiB < (SIZE_MAX / MI_KiB)) {
|
||||
if (memInKiB > 0 && memInKiB <= SIZE_MAX) {
|
||||
config->physical_memory_in_kib = memInKiB;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user