fs/file: Fix potential issue with loading very big files on 32-bit systems

This commit is contained in:
Mintsuki 2025-12-24 23:18:41 +01:00
parent 4820efdf2e
commit 07ff25bd46
No known key found for this signature in database
GPG Key ID: 1F3C021BECA23821

View File

@ -150,7 +150,7 @@ void *freadall_mode(struct file_handle *fd, uint32_t type, bool allow_high_alloc
goto low_ret;
}
void *pool = ext_mem_alloc(0x100000);
for (size_t i = 0; i < fd->size; i += 0x100000) {
for (uint64_t i = 0; i < fd->size; i += 0x100000) {
size_t count;
if (fd->size - i < 0x100000) {
count = fd->size - i;