devilhorns pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=50fb0863fc3ec013e31e58c060dfde855ee2ae72

commit 50fb0863fc3ec013e31e58c060dfde855ee2ae72
Author: Chris Michael <[email protected]>
Date:   Mon Jan 12 12:04:19 2015 -0500

    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 <[email protected]>
---
 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

-- 


Reply via email to