devicemgr: null-checking to prevent null pointer dereference 11/279811/1
authorduna.oh <duna.oh@samsung.com>
Fri, 12 Aug 2022 05:22:56 +0000 (14:22 +0900)
committerTizen Window System <tizen.windowsystem@gmail.com>
Thu, 18 Aug 2022 06:12:45 +0000 (15:12 +0900)
Change-Id: Id40d4e7fde37d963bde2071d0def3fc4cc80c4d9

src/input_devicemgr/input_devicemgr.c

index 00c99b0..69cae4f 100644 (file)
@@ -1195,7 +1195,7 @@ tz_devicemgr_pressed_keys_cleanup(struct ds_tizen_input_devicemgr *tz_devicemgr)
             wl_list_length(&tz_devicemgr->devices.kbd->key.pressed));
 
     wl_list_for_each_safe(keydata, tmp, &tz_devicemgr->devices.kbd->key.pressed, link) {
-        if (tz_devicemgr->devices.kbd)
+        if (tz_devicemgr->devices.kbd->input_device)
             tz_devicemgr_generate_key(tz_devicemgr->devices.kbd->input_device,
                     keydata->keycode, false);
         wl_list_remove(&keydata->link);