summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-05-11 07:15:27 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-05-11 07:15:32 (GMT)
commit81aec19816e053d37cea882544ca35d2203a3c5b (patch)
treee20de70f733c3a39c27ea0dc622eaae639690b07 /plugins
parent90e0f7ac04c1622f226dda57a3329b6fe98307e8 (diff)
Handled out of bound string section length (as suggested by the test suite).
Diffstat (limited to 'plugins')
-rw-r--r--plugins/readelf/strtab.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/plugins/readelf/strtab.c b/plugins/readelf/strtab.c
index 9e625fd..f8ab2c7 100644
--- a/plugins/readelf/strtab.c
+++ b/plugins/readelf/strtab.c
@@ -70,6 +70,12 @@ static void parse_elf_string_table(GElfFormat *format, GPreloadInfo *info, const
copy_vmpa(&pos, get_mrange_addr(range));
data = g_binary_content_get_raw_access(content, &pos, length);
+ /**
+ * Si la section demandée est anormalement grande (cf. exemple de la suite de
+ * tests "tests/format/elf/oob_section_name.asm")...
+ */
+ if (data == NULL) return;
+
cut = true;
/* Boucle de parcours */