add return when there is no value 71/305971/2
authordyamy-lee <dyamy.lee@samsung.com>
Tue, 13 Feb 2024 11:46:07 +0000 (20:46 +0900)
committerdyamy-lee <dyamy.lee@samsung.com>
Wed, 14 Feb 2024 11:01:24 +0000 (20:01 +0900)
If the pdirection is NULL, it can be negative value. Then, it can make overflow.
So, this patch added the checking when it is NULL and added return at that time.

Change-Id: I5be78b7cf934cb30f813b8bfafdbb0c86f6a7cf6

src/vc_elm_core.c

index 1cbf88c..ad3a5cd 100644 (file)
@@ -2046,6 +2046,8 @@ Eina_Bool _vc_elm_core_set_object_hint_direction(Evas_Object *obj, vc_elm_direct
 Eina_Bool _vc_elm_core_get_object_hint_direction(Evas_Object *obj, vc_elm_direction_e *direction)
 {
        intptr_t pdirection = (intptr_t)evas_object_data_get(obj, VC_ELM_DIRECTION);
+       if (!pdirection)
+               return EINA_FALSE;
        *direction = (vc_elm_direction_e)pdirection - 1;
        return EINA_TRUE;
 }