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 <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-06-18 10:29:06 -04:00
parent ac6a918644
commit 38698de564
1 changed files with 4 additions and 4 deletions

View File

@ -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))