From fead9bfea2ce5087cbeef110b831fdecf826e267 Mon Sep 17 00:00:00 2001 From: Artem Popov Date: Thu, 24 Nov 2016 12:13:36 +0900 Subject: [PATCH] Edje: add checking on NULL 3-rd parameter in edje_object_part_external_param_type_get() @fix Summary: add checking on NULL 3-rd parameter (param) before strcmp to avoid segfault Reviewers: cedric, jpeg, NikaWhite, myoungwoon, Hermet Reviewed By: Hermet Subscribers: Hermet, t.naumenko Differential Revision: https://phab.enlightenment.org/D4424 Change-Id: I604f6bc4f5ba3175b8179ff71bca0fe4405b8b20 --- src/lib/edje/edje_external.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lib/edje/edje_external.c b/src/lib/edje/edje_external.c index 9065f94..8e242f1 100644 --- a/src/lib/edje/edje_external.c +++ b/src/lib/edje/edje_external.c @@ -124,7 +124,7 @@ _edje_object_part_external_param_type_get(Eo *obj, Edje *ed, const char *part, c Edje_External_Type *type; Edje_External_Param_Info *info; - if ((!ed) || (!part)) return EDJE_EXTERNAL_PARAM_TYPE_MAX; + if ((!ed) || (!part) || (!param)) return EDJE_EXTERNAL_PARAM_TYPE_MAX; rp = _edje_real_part_recursive_get(&ed, (char *)part); if (!rp) @@ -147,7 +147,7 @@ _edje_object_part_external_param_type_get(Eo *obj, Edje *ed, const char *part, c return EDJE_EXTERNAL_PARAM_TYPE_MAX; } for (info = type->parameters_info; info->name; info++) - if (strcmp(info->name, param) == 0) return info->type; ; + if (strcmp(info->name, param) == 0) return info->type; ERR("no parameter '%s' external type '%s'", param, type->module_name); -- 2.7.4