cedric pushed a commit to branch master.


commit fbcd2a561fb277805b903468e1996acc15ad63e3
Author: Shilpa Singh <shilpa.si...@samsung.com>
Date:   Fri Feb 12 21:13:02 2016 +0100

    spinner: crash on illegal format set issue fix.
    Set any illegal format, spinner crashes, the format set to spinner
    has to be valid hence a check is added initially itself to check for 
validity of
    label formats.
    Signed-off-by: Shilpa Singh <shilpa.si...@samsung.com>
    Test Plan:
    1. Set illegal format to spinner for e.g: elm_spinner_label_format_set(sp, 
    2. Run spinner demo
    Crash is observed
    Reviewers: cedric
    Subscribers: govi, buds
    Differential Revision: https://phab.enlightenment.org/D3668
    Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
 src/lib/elm_spinner.c | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/src/lib/elm_spinner.c b/src/lib/elm_spinner.c
index 0e94cf1..252bb8d 100644
--- a/src/lib/elm_spinner.c
+++ b/src/lib/elm_spinner.c
@@ -1348,6 +1348,12 @@ _elm_spinner_eo_base_constructor(Eo *obj, 
Elm_Spinner_Data *_pd EINA_UNUSED)
 EOLIAN static void
 _elm_spinner_label_format_set(Eo *obj, Elm_Spinner_Data *sd, const char *fmt)
+   if (!strchr(fmt, '%'))
+     {
+        WRN("Warning: %s is an Illegal format, cannot be set", fmt);
+        return;
+     }
    eina_stringshare_replace(&sd->label, fmt);
    if (fmt && !(_is_label_format_integer(sd->label)))


Reply via email to