Check key is null for UngrabKeyList 55/322355/1
authorEunki, Hong <eunkiki.hong@samsung.com>
Tue, 8 Apr 2025 02:03:21 +0000 (11:03 +0900)
committerEunki, Hong <eunkiki.hong@samsung.com>
Tue, 8 Apr 2025 02:03:21 +0000 (11:03 +0900)
We check key is null or not at GrabKeyList API.
Let's follow the logic pairwise.

Change-Id: I5d4b8a5d92dfe9d1c5a3d9b61a418d243209c0c6
Signed-off-by: Eunki, Hong <eunkiki.hong@samsung.com>
dali/internal/window-system/tizen-wayland/ecore-wl2/window-base-ecore-wl2.cpp

index 3af142cccab88eda97b03f8eec0490b3af76cd24..0d94b239b1df29fac897154e61e45cadf608a401 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2024 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2025 Samsung Electronics Co., Ltd.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
@@ -3266,6 +3266,12 @@ bool WindowBaseEcoreWl2::UngrabKeyList(const Dali::Vector<Dali::KEY>& key, Dali:
       int index = 0;
       EINA_LIST_FOREACH(keyList, l, listData)
       {
+        if(static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key == NULL)
+        {
+          DALI_LOG_ERROR("input key list has null data!");
+          break;
+        }
+
         if(strcmp(static_cast<char*>(data), static_cast<Ecore_Wl2_Window_Keygrab_Info*>(listData)->key) == 0)
         {
           result[index] = false;