edje_cc: Fix dereference null return value
authorChris Michael <cp.michael@samsung.com>
Thu, 25 Jun 2015 18:55:44 +0000 (14:55 -0400)
committerChris Michael <cp.michael@samsung.com>
Thu, 25 Jun 2015 18:56:48 +0000 (14:56 -0400)
Summary: Fix Coverity CID1308232 which reports that we may be passing
NULL to strcmp here as the function _parse_param_get May return NULL.

@fix

Signed-off-by: Chris Michael <cp.michael@samsung.com>
src/bin/edje/edje_cc_parse.c

index 9c4e6bc..5f405df 100644 (file)
@@ -1843,10 +1843,14 @@ int
 get_param_index(char *str)
 {
    int index;
+   char *p;
 
    for(index = 0; index < get_arg_count(); index++)
      {
-        if(!strcmp(str,_parse_param_get(index)))
+        p = _parse_param_get(index);
+        if (!p) continue;
+
+        if (!strcmp(str, p))
           return index;
      }