grid_gallery: add variable null check (prevent: 486270) 38/49438/1 accepted/tizen/tv/20151014.043247 submit/tizen/20151014.005748
authorJehun Lim <jehun.lim@samsung.com>
Tue, 13 Oct 2015 06:49:12 +0000 (15:49 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Tue, 13 Oct 2015 08:09:42 +0000 (17:09 +0900)
Change-Id: I4c86b3ebe6da7f4d497fa5a04593b18a591b4f6b
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
src/grid/grid_gallery.c

index a421756..eb39a7b 100644 (file)
@@ -134,9 +134,12 @@ static char *_place_text_get(void *data, Evas_Object *obj, const char *part)
                city = strtok_r(buf, "/", &tmp);
                country = strtok_r(tmp, "", &tmp);
 
-               if (!strcmp(part, PART_ELM_TEXT_CITY))
+               if (!strcmp(part, PART_ELM_TEXT_CITY)) {
+                       if (!city)
+                               return NULL;
+
                        return strdup(city);
-               else if (!strcmp(part, PART_ELM_TEXT_COUNTRY)) {
+               else if (!strcmp(part, PART_ELM_TEXT_COUNTRY)) {
                        if (!country)
                                return NULL;