Entire large game file read into memory for MD5 check — OOM risk on 1.8 GB assets file #7
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The MD5 integrity check at line 718 loads the complete file into memory with
open(file_path, "rb").read()before hashing. The README explicitly mentions aresources.assets.resSfile that is ~1.8 GB in size.Location
4lbion.py, line 718–719:Risk
Reading 1.8 GB into RAM in a single call will likely exhaust available memory on low-RAM machines, causing the OS to kill the process or trigger heavy swap usage. The loop iterates over all files, so this could happen multiple times per update check. The file handle is also never explicitly closed (no
withstatement), leaving it open until garbage collection.Suggested fix direction
Hash the file in chunks using
hashlib.md5()withupdate():Severity
minor
Found by
Automated audit by Claude Code