ecore evas wl - cnp - dont segv is data is null submit/tizen/20200629.001406
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sun, 28 Jun 2020 21:52:17 +0000 (22:52 +0100)
committerJongmin Lee <jm105.lee@samsung.com>
Sun, 28 Jun 2020 22:34:20 +0000 (07:34 +0900)
this is probably wrong but crashing is not nice... bettr to NOP than
crash right now.

src/modules/ecore_evas/engines/wayland/ecore_evas_wayland_common.c

index 89337f1..82a75bb 100644 (file)
@@ -3621,6 +3621,11 @@ _wl_selection_receive(void *data, int type EINA_UNUSED, void *event)
    Ecore_Wl2_Event_Offer_Data_Ready *ready = event;
    Ecore_Evas_Selection_Buffer selection = ECORE_EVAS_SELECTION_BUFFER_LAST;
 
+   if ((!ready->data) || (ready->len < 1))
+     {
+        ERR("no se;lection data");
+        return ECORE_CALLBACK_PASS_ON;
+     }
    for (int i = 0; i < ECORE_EVAS_SELECTION_BUFFER_LAST; ++i)
      {
         if (wdata->selection_data[i].offer == ready->offer)