summaryrefslogtreecommitdiff
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
parent90e0f7ac04c1622f226dda57a3329b6fe98307e8 (diff)
Handled out of bound string section length (as suggested by the test suite).
-rw-r--r--ChangeLog5
-rw-r--r--plugins/readelf/strtab.c6
2 files changed, 11 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 39c0db9..8bc80cb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+17-05-11 Cyrille Bagard <nocbos@gmail.com>
+
+ * plugins/readelf/strtab.c:
+ Handle out of bound string section length (as suggested by the test suite).
+
17-05-10 Cyrille Bagard <nocbos@gmail.com>
* plugins/ropgadgets/select.c:
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 */