From 44da90189c4325833d8edd87883d449bfe6f5c5b Mon Sep 17 00:00:00 2001 From: Mathieu Laurendeau Date: Tue, 4 Sep 2018 12:53:33 +0200 Subject: [PATCH] Fix potential crash with unknown adapter type. --- core/controller.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/controller.c b/core/controller.c index 0408aef7..ed2f48d1 100644 --- a/core/controller.c +++ b/core/controller.c @@ -628,7 +628,7 @@ e_gimx_status adapter_detect() rtype = adapter_send_short_command(i, BYTE_TYPE); } - if(rtype >= 0) + if(rtype >= 0 && rtype < C_TYPE_NONE) { ginfo(_("GIMX adapter detected, controller type is: %s.\n"), controller_get_name(rtype));