summaryrefslogtreecommitdiff
path: root/src/format
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2017-08-27 18:14:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2017-08-27 18:14:19 (GMT)
commitdbb5a81c38ccbdefafc2abe3bd1e266a7fc42bc2 (patch)
treede1b90292e08154d26d4b58cb896d6d7be534b1f /src/format
parent47480a98d3c5c058755f3206765730dbfbf3ecef (diff)
Took into account that some instruction creations may fail.
Diffstat (limited to 'src/format')
-rw-r--r--src/format/elf/strings.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/format/elf/strings.c b/src/format/elf/strings.c
index e885632..2af08b2 100644
--- a/src/format/elf/strings.c
+++ b/src/format/elf/strings.c
@@ -24,6 +24,7 @@
#include "strings.h"
+#include <assert.h>
#include <ctype.h>
#include <malloc.h>
#include <string.h>
@@ -201,6 +202,7 @@ static bool parse_elf_string_data(GElfFormat *format, phys_t start, phys_t size,
init_vmpa(&pos, start + i, address + i);
instr = g_raw_instruction_new_array(content, MDS_8_BITS, end - i, &pos, format->endian);
+ assert(instr != NULL);
g_raw_instruction_mark_as_string(G_RAW_INSTRUCTION(instr), true);