keyrouter: check validation before access. 44/239344/3
authorSeunghun Lee <shiin.lee@samsung.com>
Fri, 24 Jul 2020 05:36:20 +0000 (14:36 +0900)
committerSeunghun Lee <shiin.lee@samsung.com>
Fri, 24 Jul 2020 06:21:40 +0000 (15:21 +0900)
acess violation issue fixed.

Change-Id: Ifede6709f4b3d98f70d9c75f8f6ae7d0e8cb0fa4

src/lib/keyrouter/keyrouter.c

index b8d69f1..81ddfeb 100644 (file)
@@ -234,6 +234,11 @@ keyrouter_grab_key(keyrouter_t *keyrouter,
        pepper_list_init(&info->link);
 
        list = keyrouter_grabbed_list_get(keyrouter, type, keycode);
+       if (!list) {
+               PEPPER_ERROR("keycode(%d) had no list for type(%d)\n", keycode, type);
+               free(info);
+               return TIZEN_KEYROUTER_ERROR_INVALID_MODE;
+       }
 
        if (!keyrouter->hard_keys[keycode].keycode)
                keyrouter->hard_keys[keycode].keycode = keycode;