GNOME Bugzilla – Bug 654539
gnome-shell segfaults with invalid button_layout gconf key
Last modified: 2011-07-24 00:50:30 UTC
gnome-shell segfaults when the ":" is missing from gconf key /desktop/gnome/shell/windows/button_layout. For example, if it's set to "minimize,close", gnome-shell crashes upon opening the first window. gnome-shell-3.0.2-1.fc15 on x86-64, Intel X3100 graphics.
Created attachment 192543 [details] [review] prefs: Initialize button_layout struct even on pref string corner cases We were leaving some members of the button_layout struct uninitialized if the pref string didn't have at least one colon or if it was an empty string ("").
Review of attachment 192543 [details] [review]: Looks good, minor style suggestion. ::: src/core/prefs.c @@ +1742,3 @@ + { + new_layout.left_buttons[0] = META_BUTTON_FUNCTION_LAST; + new_layout.left_buttons_has_spacer[0] = FALSE; Code looks correct, but if you initialize i before the if block, you can just move new_layout.left_buttons[i] = META_BUTTON_FUNCTION_LAST; new_layout.left_buttons_has_spacer[i] = FALSE; below the block (e.g. no else{} needed). @@ +1806,3 @@ + { + new_layout.right_buttons[0] = META_BUTTON_FUNCTION_LAST; + new_layout.right_buttons_has_spacer[0] = FALSE; Dito.
Created attachment 192546 [details] [review] prefs: Initialize button_layout struct even on pref string corner cases We were leaving some members of the button_layout struct uninitialized if the pref string didn't have at least one colon or if it was an empty string (""). -- Addressed review comments.
Review of attachment 192546 [details] [review]: Looks good.
Attachment 192546 [details] pushed as 779ef58 - prefs: Initialize button_layout struct even on pref string corner cases