After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 756194 - xadapter: Avoid a crash when Xkl doesn't know the real xkb groups
xadapter: Avoid a crash when Xkl doesn't know the real xkb groups
Status: RESOLVED FIXED
Product: caribou
Classification: Applications
Component: default
git master
Other All
: Normal normal
: ---
Assigned To: caribou-maint
caribou-maint
Depends on:
Blocks:
 
 
Reported: 2015-10-07 16:23 UTC by Rui Matos
Modified: 2015-10-12 23:55 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
xadapter: Avoid a crash when Xkl doesn't know the real xkb groups (1.86 KB, patch)
2015-10-07 16:23 UTC, Rui Matos
committed Details | Review

Description Rui Matos 2015-10-07 16:23:00 UTC
Reported in https://bugzilla.redhat.com/show_bug.cgi?id=1228935
Comment 1 Rui Matos 2015-10-07 16:23:04 UTC
Created attachment 312836 [details] [review]
xadapter: Avoid a crash when Xkl doesn't know the real xkb groups

Xkl.ConfigRec gets its layouts and variants from the _XKB_RULES_NAMES
root window property which isn't specified anywhere and in fact
doesn't get set under Xwayland. The group index though is accurate
which means that we might end up trying to access an invalid index on
the layouts or variants array and crashing.

Avoid this by just lying to the caller since we can't obtain the real
layout/variant names in that case. Since this only happens under
Xwayland and in that case the only consumer of this API is gnome-shell
which ends up not using the names, this should be safe.
Comment 2 Daiki Ueno 2015-10-08 00:53:15 UTC
Review of attachment 312836 [details] [review]:

That makes sense.  Thanks.
Comment 3 Daiki Ueno 2015-10-12 23:54:58 UTC
Attachment 312836 [details] pushed as 2f98ddd - xadapter: Avoid a crash when Xkl doesn't know the real xkb groups