edje: Fix potential NULL pointer dereference
authorChris Michael <cpmichael@osg.samsung.com>
Mon, 25 Jan 2016 12:47:03 +0000 (07:47 -0500)
committerChris Michael <cpmichael@osg.samsung.com>
Mon, 25 Jan 2016 12:47:03 +0000 (07:47 -0500)
It is possible that evas_object_data_get here does not return an Edje,
so check the return value. This fixes a coverity reported issue.

@fix
CID1349866

Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
src/lib/edje/edje_util.c

index 221bd1d..4bb0e9c 100644 (file)
@@ -3505,8 +3505,11 @@ _edje_object_part_swallow(Eo *obj EINA_UNUSED, Edje *ed, const char *part, Evas_
         /* the object is already swallowed in the requested part */
         if (rpcur == rp) return EINA_TRUE;
         sed = evas_object_data_get(obj_swallow, ".edje");
-        /* The object is already swallowed somewhere, unswallow it first */
-        edje_object_part_unswallow(sed->obj, obj_swallow);
+        if (sed)
+          {
+             /* The object is already swallowed somewhere, unswallow it first */
+             edje_object_part_unswallow(sed->obj, obj_swallow);
+          }
      }
 
    if (!rp)