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 668545 - Possible NULL pointer dereferences in gsd-wacom-device
Possible NULL pointer dereferences in gsd-wacom-device
Status: RESOLVED FIXED
Product: gnome-settings-daemon
Classification: Core
Component: wacom
unspecified
Other All
: Normal normal
: ---
Assigned To: gnome-settings-daemon-maint
gnome-settings-daemon-maint
Depends on:
Blocks:
 
 
Reported: 2012-01-24 00:00 UTC by Jason Gerecke
Modified: 2012-01-25 12:31 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
wacom: Fix NULL pointer dereference (1.07 KB, patch)
2012-01-24 00:00 UTC, Jason Gerecke
committed Details | Review
wacom: Fix NULL pointer dereference (1.54 KB, patch)
2012-01-24 00:00 UTC, Jason Gerecke
needs-work Details | Review
wacom: Fix NULL pointer dereference (1.54 KB, patch)
2012-01-24 20:44 UTC, Jason Gerecke
committed Details | Review

Description Jason Gerecke 2012-01-24 00:00:05 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.
Comment 1 Jason Gerecke 2012-01-24 00:00:07 UTC
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.
Comment 2 Jason Gerecke 2012-01-24 00:00:10 UTC
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 ["", "", ""].
Comment 3 Bastien Nocera 2012-01-24 11:37:56 UTC
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 ("");
Comment 4 Bastien Nocera 2012-01-24 11:38:21 UTC
Review of attachment 205929 [details] [review]:

Looks good.
Comment 5 Jason Gerecke 2012-01-24 20:44:25 UTC
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 ["", "", ""].
Comment 6 Bastien Nocera 2012-01-25 12:31:26 UTC
Attachment 205929 [details] pushed as dd1a176 - wacom: Fix NULL pointer dereference
Attachment 206019 [details] pushed as dd1a176 - wacom: Fix NULL pointer dereference