From 38698de56402c460b203f242d58f86a0d19bd144 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Thu, 18 Jun 2015 10:29:06 -0400 Subject: [PATCH] edje: Fix Coverity CID1299026 and CID1299027: Explicit null dereference Summary: Coverity reports that this potentially is passing a NULL pointer to strcmp. As the GETSTR macro Can possible return NULL we should be checking that return before passing it to strcmp. @fix Signed-off-by: Chris Michael --- src/lib/edje/edje_embryo.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/lib/edje/edje_embryo.c b/src/lib/edje/edje_embryo.c index f3a7400..e05cb0c 100644 --- a/src/lib/edje/edje_embryo.c +++ b/src/lib/edje/edje_embryo.c @@ -1100,7 +1100,7 @@ _edje_embryo_fn_set_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(6)) { GETSTR(tmp, params[6]); - if (!strcmp(tmp, "CURRENT")) + if ((tmp) && (!strcmp(tmp, "CURRENT"))) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } } @@ -1110,7 +1110,7 @@ _edje_embryo_fn_set_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(7)) { GETSTR(tmp, params[7]); - if (!strcmp(tmp, "CURRENT")) + if ((tmp) && (!strcmp(tmp, "CURRENT"))) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } else if (HASNPARAMS(5)) @@ -1126,7 +1126,7 @@ _edje_embryo_fn_set_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(8)) { GETSTR(tmp, params[8]); - if (!strcmp(tmp, "CURRENT")) + if ((tmp) && (!strcmp(tmp, "CURRENT"))) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } else if (HASNPARAMS(5)) @@ -1142,7 +1142,7 @@ _edje_embryo_fn_set_state_anim(Embryo_Program *ep, Embryo_Cell *params) if (HASNPARAMS(12)) { GETSTR(tmp, params[8]); - if (!strcmp(tmp, "CURRENT")) + if ((tmp) && (!strcmp(tmp, "CURRENT"))) anim_type |= EDJE_TWEEN_MODE_OPT_FROM_CURRENT; } else if (HASNPARAMS(5)) -- 2.7.4