summaryrefslogtreecommitdiff
path: root/src/modules
diff options
context:
space:
mode:
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-09 00:39:19 +0100
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>2019-08-09 00:39:19 +0100
commit7c4e58a2fcdb824afdcabc8aee3bacf2a30e3d69 (patch)
treed68ee089fe19c823feb7854fd8fa82aeec4b7c05 /src/modules
parentac6ceb0b99282be4059e5fcae4d4ca0e6f022736 (diff)
xkb - module - fix use after free - duplicate layout info instead
instead of referring to what migh tbe deleted under us - make a dup of it to tsatore locally. fixes segv on kbd layout change @fix
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/xkbswitch/e_mod_main.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/modules/xkbswitch/e_mod_main.c b/src/modules/xkbswitch/e_mod_main.c
index af1b801..a361a52 100644
--- a/src/modules/xkbswitch/e_mod_main.c
+++ b/src/modules/xkbswitch/e_mod_main.c
@@ -146,7 +146,7 @@ _xkb_update_icon(int cur_group)
146 EINA_LIST_FOREACH(instances, l, inst) 146 EINA_LIST_FOREACH(instances, l, inst)
147 { 147 {
148 if (!e_config_xkb_layout_eq(e_config->xkb.current_layout, inst->layout)) 148 if (!e_config_xkb_layout_eq(e_config->xkb.current_layout, inst->layout))
149 inst->layout = e_config->xkb.current_layout; 149 inst->layout = e_config_xkb_layout_dup(e_config->xkb.current_layout);
150 E_FREE_FUNC(inst->o_xkbflag, evas_object_del); 150 E_FREE_FUNC(inst->o_xkbflag, evas_object_del);
151 e_theme_edje_object_set(inst->o_xkbswitch, 151 e_theme_edje_object_set(inst->o_xkbswitch,
152 "base/theme/modules/xkbswitch", 152 "base/theme/modules/xkbswitch",
@@ -160,7 +160,7 @@ _xkb_update_icon(int cur_group)
160 EINA_LIST_FOREACH(instances, l, inst) 160 EINA_LIST_FOREACH(instances, l, inst)
161 { 161 {
162 if (!e_config_xkb_layout_eq(e_config->xkb.current_layout, inst->layout)) 162 if (!e_config_xkb_layout_eq(e_config->xkb.current_layout, inst->layout))
163 inst->layout = e_config->xkb.current_layout; 163 inst->layout = e_config_xkb_layout_dup(e_config->xkb.current_layout);
164 if (!inst->o_xkbflag) 164 if (!inst->o_xkbflag)
165 inst->o_xkbflag = e_icon_add(inst->gcc->gadcon->evas); 165 inst->o_xkbflag = e_icon_add(inst->gcc->gadcon->evas);
166 e_theme_edje_object_set(inst->o_xkbswitch, 166 e_theme_edje_object_set(inst->o_xkbswitch,
@@ -186,7 +186,7 @@ _gc_init(E_Gadcon *gc, const char *gcname, const char *id, const char *style)
186 inst = E_NEW(Instance, 1); 186 inst = E_NEW(Instance, 1);
187 /* The gadget */ 187 /* The gadget */
188 inst->o_xkbswitch = edje_object_add(gc->evas); 188 inst->o_xkbswitch = edje_object_add(gc->evas);
189 inst->layout = e_xkb_layout_get(); 189 inst->layout = e_config_xkb_layout_dup(e_xkb_layout_get());
190 if (e_config->xkb.only_label || (!inst->layout)) 190 if (e_config->xkb.only_label || (!inst->layout))
191 e_theme_edje_object_set(inst->o_xkbswitch, 191 e_theme_edje_object_set(inst->o_xkbswitch,
192 "base/theme/modules/xkbswitch", 192 "base/theme/modules/xkbswitch",
@@ -242,6 +242,7 @@ _gc_shutdown(E_Gadcon_Client *gcc)
242 evas_object_del(inst->o_xkbswitch); 242 evas_object_del(inst->o_xkbswitch);
243 evas_object_del(inst->o_xkbflag); 243 evas_object_del(inst->o_xkbflag);
244 } 244 }
245 e_config_xkb_layout_free(inst->layout);
245 E_FREE(inst); 246 E_FREE(inst);
246} 247}
247 248