Push ELF export limit to a constant

This commit is contained in:
cstation
2023-07-22 18:56:51 +02:00
parent c7e28eaf29
commit 8373b5ed5a
2 changed files with 5 additions and 2 deletions
@@ -234,3 +234,5 @@ BLUETOOTH_PROTOCOLS = (
"HIDP",
"AVDTP",
)
ELF_MAX_EXTRACTION_SIZE = 1024 * 1024 * 1024 * 4 - 1
+3 -2
View File
@@ -105,8 +105,9 @@ class Elfs(plugins.PluginInterface):
real_size = end - start
if real_size < 0 or real_size > 100000000:
continue
# Check if ELF has a legitimate size
if real_size < 0 or real_size > constants.linux.ELF_MAX_EXTRACTION_SIZE:
raise ValueError(f"The claimed size of the ELF is invalid: {real_size}")
sections[start] = real_size