summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Michael <cp.michael@samsung.com>2015-01-12 12:04:19 -0500
committerChris Michael <cp.michael@samsung.com>2015-01-12 12:04:19 -0500
commit50fb0863fc3ec013e31e58c060dfde855ee2ae72 (patch)
tree6733e95795383c8d9dcdb63e7bac36aef2164cef
parent2ccba474a635e45b19ae0ddc1053aa1a290ca6d8 (diff)
elementary: Fix dereference of null return value
Summary: This fixes Coverity CID1261370. strrchr can return NULL here, so we need to check that 'p' is valid. @fix Signed-off-by: Chris Michael <cp.michael@samsung.com>
-rw-r--r--src/bin/test_icon.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/bin/test_icon.c b/src/bin/test_icon.c
index 97cd393e8..b98d133c4 100644
--- a/src/bin/test_icon.c
+++ b/src/bin/test_icon.c
@@ -159,8 +159,8 @@ _standard_list_populate(Evas_Object *list, Elm_Icon_Lookup_Order order)
159 { 159 {
160 // group = "/elm/icon/standard-name/style/maybe_another_style??" 160 // group = "/elm/icon/standard-name/style/maybe_another_style??"
161 snprintf(name, sizeof(name), "%s", group + 9); 161 snprintf(name, sizeof(name), "%s", group + 9);
162 p = strrchr(name, '/'); 162 if ((p = strrchr(name, '/')))
163 *p = '\0'; 163 *p = '\0';
164 printf("Found group:%s Name:%s\n", group, name); 164 printf("Found group:%s Name:%s\n", group, name);
165 165
166 // quick hack to show only standard-compliant icons 166 // quick hack to show only standard-compliant icons