From 50fb0863fc3ec013e31e58c060dfde855ee2ae72 Mon Sep 17 00:00:00 2001 From: Chris Michael Date: Mon, 12 Jan 2015 12:04:19 -0500 Subject: [PATCH] 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 --- src/bin/test_icon.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/bin/test_icon.c b/src/bin/test_icon.c index 97cd393..b98d133 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) { // group = "/elm/icon/standard-name/style/maybe_another_style??" snprintf(name, sizeof(name), "%s", group + 9); - p = strrchr(name, '/'); - *p = '\0'; + if ((p = strrchr(name, '/'))) + *p = '\0'; printf("Found group:%s Name:%s\n", group, name); // quick hack to show only standard-compliant icons -- 2.7.4