From 11047009c222d3dba1380e63c3099cce0dbc6996 Mon Sep 17 00:00:00 2001
From: Cyrille Bagard <nocbos@gmail.com>
Date: Sun, 28 Feb 2016 18:28:35 +0100
Subject: Been sure to process relevant only file formats (ELF here).

---
 ChangeLog                |  6 ++++++
 plugins/readelf/reader.c | 19 +++++++++++++++----
 plugins/readelf/reader.h |  2 +-
 3 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 1462654..b75257d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+16-02-28  Cyrille Bagard <nocbos@gmail.com>
+
+	* plugins/readelf/reader.c:
+	* plugins/readelf/reader.h:
+	Be sure to process relevant only file formats (ELF here).
+
 16-02-20  Cyrille Bagard <nocbos@gmail.com>
 
 	* src/gui/menus/view.c:
diff --git a/plugins/readelf/reader.c b/plugins/readelf/reader.c
index 5da60b7..2d10540 100644
--- a/plugins/readelf/reader.c
+++ b/plugins/readelf/reader.c
@@ -51,15 +51,26 @@ DEFINE_CHRYSALIDE_ACTIVE_PLUGIN("readelf", "Displays information about ELF files
 *                                                                             *
 ******************************************************************************/
 
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GElfFormat *format)
+G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *plugin, PluginAction action, GBinFormat *format)
 {
     bool result;                            /* Bilan à retourner           */
+    GElfFormat *elf_fmt;                    /* Version ELF                 */
 
-    result = annotate_elf_header(format);
+    if (!G_IS_ELF_FORMAT(format))
+    {
+        result = true;
+        goto hbf_exit;
+    }
 
-    result &= annotate_elf_program_header_table(format);
+    elf_fmt = G_ELF_FORMAT(format);
 
-    result &= annotate_elf_section_header_table(format);
+    result = annotate_elf_header(elf_fmt);
+
+    result &= annotate_elf_program_header_table(elf_fmt);
+
+    result &= annotate_elf_section_header_table(elf_fmt);
+
+ hbf_exit:
 
     return result;
 
diff --git a/plugins/readelf/reader.h b/plugins/readelf/reader.h
index fe997b6..0080766 100644
--- a/plugins/readelf/reader.h
+++ b/plugins/readelf/reader.h
@@ -32,7 +32,7 @@
 
 
 /* Etablit des symboles complémentaires dans un format ELF. */
-G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GElfFormat *);
+G_MODULE_EXPORT bool handle_binary_format(const GPluginModule *, PluginAction, GBinFormat *);
 
 
 
-- 
cgit v0.11.2-87-g4458