When the X11Variant localed property was empty, variants[i] was
being checked even though only variants[0] was defined (an empty
string).
==17035== Invalid read of size 8
==17035== at 0x26B9529A: on_localed_properties_changed (gnome-region-panel-system.c:339)
==17035== by 0x26B95546: localed_proxy_ready (gnome-region-panel-system.c:381)
==17035== by 0x8CA2589: g_simple_async_result_complete (gsimpleasyncresult.c:775)
==17035== by 0x8CA25BB: complete_in_idle_cb (gsimpleasyncresult.c:787)
==17035== by 0x94B8ED4: g_idle_dispatch (gmain.c:4806)
==17035== by 0x94B6890: g_main_dispatch (gmain.c:2715)
==17035== by 0x94B7440: g_main_context_dispatch (gmain.c:3219)
==17035== by 0x94B7623: g_main_context_iterate (gmain.c:3290)
==17035== by 0x94B76E7: g_main_context_iteration (gmain.c:3351)
==17035== by 0x8CDB1A1: g_application_run (gapplication.c:1620)
==17035== by 0x4083C6: main (control-center.c:256)
==17035== Address 0x13b92e18 is 0 bytes after a block of size 8 alloc'd
==17035== at 0x4A0883C: malloc (vg_replace_malloc.c:270)
==17035== by 0x94BE97B: standard_malloc (gmem.c:85)
==17035== by 0x94BEA04: g_malloc (gmem.c:159)
==17035== by 0x94BED2F: g_malloc_n (gmem.c:400)
==17035== by 0x94DB26A: g_strsplit (gstrfuncs.c:2281)
==17035== by 0x26B95169: on_localed_properties_changed (gnome-region-panel-system.c:319)
==17035== by 0x26B95546: localed_proxy_ready (gnome-region-panel-system.c:381)
==17035== by 0x8CA2589: g_simple_async_result_complete (gsimpleasyncresult.c:775)
==17035== by 0x8CA25BB: complete_in_idle_cb (gsimpleasyncresult.c:787)
==17035== by 0x94B8ED4: g_idle_dispatch (gmain.c:4806)
==17035== by 0x94B6890: g_main_dispatch (gmain.c:2715)
==17035== by 0x94B7440: g_main_context_dispatch (gmain.c:3219)
Unfortunately we don't have a way yet to make gsettings system wide
defaults so we are just using the localed API to export the XKB input
sources and ignore the IBus ones.
https://bugzilla.gnome.org/show_bug.cgi?id=683875
Instead of splitting the list of layouts into layouts and variants,
we were expecting strings of the form:
layout1 variant1, layout2 variant2
to be handled automatically. We should instead create the lists
of layouts and variants separately before passing them to localed.
https://bugzilla.gnome.org/show_bug.cgi?id=670607
Using systemd's SetX11Keyboard() method in localed. Disable
the functionality altogether if systemd is not found.
This version supports multiple keyboard layouts by passing comma
separated layouts, as supported by X11.
https://bugzilla.gnome.org/show_bug.cgi?id=659300
This code was creating a GString conditionally, but using
it unconditionally afterwards. Instead of special-casing
the str == NULL case, just always create it.