summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWonki Kim <wonki_.kim@samsung.com>2020-10-12 02:32:10 +0000
committerChristopher Michael <devilhorns@comcast.net>2021-01-19 16:33:13 -0500
commit728d4dba16bd079ded043bc4b61f464bc7ad48b0 (patch)
tree3849e16190e5431e97dccf4138ec0991b3e0352d
parent0d9cc0a562faf040e7fd4f3c842439632c1796fa (diff)
slider: fix a potentional crashing problem
null pointer dereferencing could happen once eina_value_setup fails. this patch fixes the problem in adavnace Reviewed-by: Christopher Michael <devilhorns@comcast.net> Differential Revision: https://phab.enlightenment.org/D12173
-rw-r--r--src/lib/elementary/elm_slider.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/lib/elementary/elm_slider.c b/src/lib/elementary/elm_slider.c
index 439711c392..6604c4c2fb 100644
--- a/src/lib/elementary/elm_slider.c
+++ b/src/lib/elementary/elm_slider.c
@@ -102,7 +102,7 @@ _units_set(Evas_Object *obj)
102 { 102 {
103 Eina_Value val; 103 Eina_Value val;
104 104
105 eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE); 105 if (!eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE)) return;
106 106
107 eina_strbuf_reset(sd->format_strbuf); 107 eina_strbuf_reset(sd->format_strbuf);
108 if (!sd->intvl_enable) 108 if (!sd->intvl_enable)
@@ -147,7 +147,7 @@ _indicator_set(Evas_Object *obj)
147 147
148 if (!sd->indi_format_cb) return; 148 if (!sd->indi_format_cb) return;
149 149
150 eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE); 150 if (!eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE)) return;
151 eina_strbuf_reset(sd->indi_format_strbuf); 151 eina_strbuf_reset(sd->indi_format_strbuf);
152 152
153 eina_value_set(&val, sd->val); 153 eina_value_set(&val, sd->val);
@@ -180,7 +180,7 @@ _min_max_set(Evas_Object *obj)
180 Eina_Value val; 180 Eina_Value val;
181 181
182 if (!sd->format_cb) return; 182 if (!sd->format_cb) return;
183 eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE); 183 if (!eina_value_setup(&val, EINA_VALUE_TYPE_DOUBLE)) return;
184 184
185 str = eina_strbuf_new(); 185 str = eina_strbuf_new();
186 186