Commit 7810a8c
committed
fix: use incremental hashing in CatalogDescriptor.get_hash() to avoid loading entire file into memory
CatalogDescriptor.get_hash() called fh.read() which loads the entire
file into memory before hashing. Use incremental hashlib.sha256().update()
with 64 KiB chunks to prevent unbounded memory allocation on large
catalog descriptor files.1 parent 5e2f9bc commit 7810a8c
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
841 | 841 | | |
842 | 842 | | |
843 | 843 | | |
| 844 | + | |
844 | 845 | | |
845 | | - | |
| 846 | + | |
| 847 | + | |
| 848 | + | |
0 commit comments