Fix dereference before NULL check

This commit is contained in:
twinaphex 2017-09-18 16:39:28 +02:00
parent 60c7f8e35f
commit fa7a792180

View File

@ -498,15 +498,17 @@ static void menu_action_setting_disp_set_label_input_desc_kbd(
const char *path,
char *s2, size_t len2)
{
settings_t *settings = config_get_ptr();
unsigned key_id;
unsigned remap_id =
settings->uints.input_keymapper_ids[type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN];
char desc[PATH_MAX_LENGTH];
unsigned key_id;
unsigned remap_id;
settings_t *settings = config_get_ptr();
if (!settings)
return;
remap_id =
settings->uints.input_keymapper_ids[type - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN];
for (key_id = 0; key_id < MENU_SETTINGS_INPUT_DESC_KBD_END - MENU_SETTINGS_INPUT_DESC_KBD_BEGIN; key_id++)
{
if(remap_id == key_descriptors[key_id].key)