leif pushed a commit to branch master.

commit 0a89a7b477a4de507c29696a66efc596914e1e9a
Author: Leif Middelschulte <[email protected]>
Date:   Tue Jun 4 12:09:47 2013 +0200

    Fix segfault related to strdup.
    
    Summary: This patch fixes a segfault that happens when you create a 
flipselector theme without an "elm.top" part.
    
    Reviewers: cedric
    
    Reviewed By: cedric
    
    Differential Revision: https://phab.enlightenment.org/D156
---
 src/lib/elm_flipselector.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/lib/elm_flipselector.c b/src/lib/elm_flipselector.c
index 4f2ee2e..1e4e794 100644
--- a/src/lib/elm_flipselector.c
+++ b/src/lib/elm_flipselector.c
@@ -62,8 +62,10 @@ _elm_flipselector_smart_sizing_eval(Eo *obj, void *_pd, 
va_list *list EINA_UNUSE
    if (sd->sentinel)
      {
         const char *label = elm_object_item_text_get(DATA_GET(sd->sentinel));
+        const char *src = elm_layout_text_get(obj, "elm.top");
 
-        tmp = strdup(elm_layout_text_get(obj, "elm.top"));
+        if (src)
+            tmp = strdup(src);
         elm_layout_text_set(obj, "elm.top", label);
      }
 

-- 

------------------------------------------------------------------------------
How ServiceNow helps IT people transform IT departments:
1. A cloud service to automate IT design, transition and operations
2. Dashboards that offer high-level views of enterprise services
3. A single system of record for all IT processes
http://p.sf.net/sfu/servicenow-d2d-j

Reply via email to