GNOME Bugzilla – Bug 668545
Possible NULL pointer dereferences in gsd-wacom-device
Last modified: 2012-01-25 12:31:32 UTC
The functions 'find_output_by_display' and 'set_display_by_output' do not check their input for NULL before use. The attached patches fix these possible dereference issues.
Created attachment 205929 [details] [review] wacom: Fix NULL pointer dereference If the public gsd_wacom_device_get_display_monitor function is called, it eventually finds its way up here. With a NULL 'device' argument, we segfault rather than gracefully returning NULL as other exceptional conditions in the function do.
Created attachment 205930 [details] [review] wacom: Fix NULL pointer dereference Fixes a potential NULL pointer dereference in the set_display_ by_output function. If provided with a NULL, we assume that the mapping should be reset to the default of ["", "", ""].
Review of attachment 205930 [details] [review]: ::: plugins/wacom/gsd-wacom-device.c @@ +514,3 @@ + if (rr_output_info == NULL) + { + o_vendor = g_malloc0(1); o_vendor = g_strdup ("");
Review of attachment 205929 [details] [review]: Looks good.
Created attachment 206019 [details] [review] wacom: Fix NULL pointer dereference Fixes a potential NULL pointer dereference in the set_display_ by_output function. If provided with a NULL, we assume that the mapping should be reset to the default of ["", "", ""].
Attachment 205929 [details] pushed as dd1a176 - wacom: Fix NULL pointer dereference Attachment 206019 [details] pushed as dd1a176 - wacom: Fix NULL pointer dereference