! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Segfault in convert_xfce_output_info when plugging in an external model
Status:
RESOLVED: FIXED
Product:
Xfce4-settings
Component:
Display Settings

Comments

Description Richard W.M. Jones 2016-05-20 21:38:04 CEST
There is a crash in convert_xfce_output_info where it dereferences
a NULL pointer when an external monitor is plugged in.

The code is:

1592	static XfceOutputInfo *convert_xfce_output_info (gint output_id)
1593	{
1594	    XfceOutputInfo *output;
1595	    const XfceRRMode *mode, *preferred;
1596	    RRMode preferred_mode;
1597	    gint x, y;
1598	
1599	    xfce_randr_get_positions(xfce_randr, output_id, &x, &y);
1600	    mode = xfce_randr_find_mode_by_id (xfce_randr, output_id, xfce_randr->mode[output_id]);
1601	    preferred_mode = xfce_randr_preferred_mode(xfce_randr, output_id);
1602	    preferred = xfce_randr_find_mode_by_id (xfce_randr, output_id, preferred_mode);
            ^ here preferred == NULL
1603	    output = g_new0 (XfceOutputInfo, 1);
1604	    output->id = output_id;
1605	    output->x = x;
1606	    output->y = y;
1607	    output->user_data = NULL;
1608	    output->display_name = xfce_randr->friendly_name[output_id];
1609	    output->connected = TRUE;
1610	    output->on = xfce_randr->mode[output_id] != None;
1611	    output->pref_width = preferred->width;
                                 ^ crash happens here

There's a bit more detail including a reproducer in the Fedora
downstream bug report:

https://bugzilla.redhat.com/show_bug.cgi?id=1317382#c4
https://bugzilla.redhat.com/show_bug.cgi?id=1317382#c5
Comment 1 Richard W.M. Jones 2016-05-20 21:41:12 CEST
I think https://bugzilla.xfce.org/show_bug.cgi?id=12350
could be in some way related to this one.  They are certainly
in very similar places in the code.
Comment 2 Sean Davis editbugs 2016-08-13 15:21:18 CEST
Hello, I have added a patch that should resolve this issue. Please see https://git.xfce.org/xfce/xfce4-settings/commit/?id=cd1ef4dc2a5323f130c31754a631caa228c9fd3b and let me know if this helps.

Bug #12580

Reported by:
Richard W.M. Jones
Reported on: 2016-05-20
Last modified on: 2020-05-28

People

Assignee:
Jérôme Guelfucci
CC List:
5 users

Version

Version:
4.12.0

Attachments

Additional information