GNOME Bugzilla – Bug 647777
[PATCH] crash in compute_above_tab_keycode
Last modified: 2011-05-25 18:22:43 UTC
Created attachment 185957 [details] [review] trivial fix On an F15 system, starting an Xdmx server as follows: % cat xdmx.conf virtual default { display :0 1280x800 @0x0; } % Xdmx -configfile xdmx.conf :1 makes mutter crash: Program received signal SIGSEGV, Segmentation fault. compute_above_tab_keycode (xdisplay=0x96c7ab0) at core/above-tab-keycode.c:80 80 geometry = keyboard->geom; I'm at something of a loss at the moment to explain why XkbGetKeyboard would return NULL here, but clearly X is not to be trusted.
Comment on attachment 185957 [details] [review] trivial fix >+ if (!keyboard) >+ goto out; out: XkbFreeKeyboard (keyboard, 0, True); that seems not good? You could just "return best_keycode;" instead. > I'm at something of a loss at the moment to explain why XkbGetKeyboard would > return NULL here See also the comment above the XkbGetKeyboard call.
(In reply to comment #1) > (From update of attachment 185957 [details] [review]) > >+ if (!keyboard) > >+ goto out; > > out: > XkbFreeKeyboard (keyboard, 0, True); > > that seems not good? You could just "return best_keycode;" instead. XkbFreeKeyboard(keyboard=NULL) happens to behave like free(NULL) - ie, safely - but yeah, easier to just return.
Created attachment 186605 [details] [review] Updated patch