From 81aec19816e053d37cea882544ca35d2203a3c5b Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Thu, 11 May 2017 09:15:27 +0200
Subject: Handled out of bound string section length (as suggested by the test
 suite).

---
 ChangeLog                | 5 +++++
 plugins/readelf/strtab.c | 6 ++++++
 2 files changed, 11 insertions(+)

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 */
-- 
cgit v0.11.2-87-g4458