summaryrefslogtreecommitdiff
path: root/src/analysis/binary.c
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2019-01-21 18:39:40 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2019-01-21 18:39:40 (GMT)
commit7c04cf1a2dcc9e04ce8f280f399d6904053e89d9 (patch)
tree913d6685f00328ea7fdd9db756f3354c6893b265 /src/analysis/binary.c
parentfe679c19bb156abb348184b1dd222adb61164c23 (diff)
Handled cases when the required processor is not found.
Diffstat (limited to 'src/analysis/binary.c')
-rw-r--r--src/analysis/binary.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/analysis/binary.c b/src/analysis/binary.c
index c38a725..8964973 100644
--- a/src/analysis/binary.c
+++ b/src/analysis/binary.c
@@ -1272,7 +1272,8 @@ GArchProcessor *g_loaded_binary_get_processor(const GLoadedBinary *binary)
result = binary->proc;
- g_object_ref(G_OBJECT(result));
+ if (result != NULL)
+ g_object_ref(G_OBJECT(result));
return result;
@@ -1727,6 +1728,7 @@ static bool g_loaded_binary_analyze(GLoadedBinary *binary, wgroup_id_t gid, GtkS
if (desc == NULL)
{
log_simple_message(LMT_INFO, _("Unknown architecture"));
+ result = false;
goto glba_exit;
}
else
@@ -1737,6 +1739,7 @@ static bool g_loaded_binary_analyze(GLoadedBinary *binary, wgroup_id_t gid, GtkS
if (binary->proc == NULL)
{
log_simple_message(LMT_ERROR, _("Unable to load the required processor"));
+ result = false;
goto glba_exit;
}
@@ -1768,8 +1771,6 @@ static bool g_loaded_binary_analyze(GLoadedBinary *binary, wgroup_id_t gid, GtkS
}
- result = true;
-
glba_exit:
return result;