Skip to content

Commit

Permalink
Fix potential crash with unknown adapter type.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mathieu Laurendeau committed Sep 4, 2018
1 parent a4dd0f2 commit 44da901
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/controller.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));

Expand Down

0 comments on commit 44da901

Please sign in to comment.