[M120 Migration] Fixes svace issues 49/311049/2 submit/tizen/20240513.160016
authorjiangyuwei <yuwei.jiang@samsung.com>
Mon, 13 May 2024 08:22:37 +0000 (16:22 +0800)
committerBot Blink <blinkbot@samsung.com>
Mon, 13 May 2024 09:32:37 +0000 (09:32 +0000)
This patch fixes the following issues:
Return value of a function 'evas_device_name_get' is dereferenced
at efl_event_handler.cc:983 without checking for NULL.

Add null check for the device_name.

References:
  - https://review.tizen.org/gerrit/302969/

Change-Id: I3df82fec4d639e5a5e3b61355f3b1b48feef905c
Signed-off-by: jiangyuwei <yuwei.jiang@samsung.com>
tizen_src/chromium_impl/ui/ozone/platform/efl/efl_event_handler.cc

index dfeb120d6eeb60bf0a388bd2769dd14c642402cf..f94751a4219fd3113c73fb5bed676df4a73e3e35 100644 (file)
@@ -982,7 +982,8 @@ void EflEventHandler::ConvertUpToReturnBackIfNeeded(EVT* evt, bool is_press) {
   // No need hide IME panel when press the IME panel's up key.
   Evas_Device_Class device_id = evas_device_class_get(evt->dev);
   const char* device_name = evas_device_name_get(evt->dev);
-  if (device_id != EVAS_DEVICE_CLASS_KEYBOARD || !strcmp(device_name, "ime"))
+  if (device_id != EVAS_DEVICE_CLASS_KEYBOARD ||
+      (device_name != nullptr && !strcmp(device_name, "ime")))
     return;
 
   if (is_press) {