Skip to content

Commit

Permalink
randr: Do not update ConnectionInfo if NULL
Browse files Browse the repository at this point in the history
Backport of this xorg-xserver commit:

  commit 941aeb3b92e644923bd112eef8023f033a140ee6
  Author: Olivier Fourdan <ofourdan@redhat.com>
  Date:   Fri May 13 08:58:58 2016 +0200

    randr: Do not update ConnectionInfo if NULL

    RRScreenSizeNotify() will update the connection information block, but
    if this occurs during initialization before ConnectionInfo is even
    initialized, this will lead to a crash.

    Simply check for ConnectionInfo prior to update it to avoid the crash.

    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95337
    Reviewed-by: Adam Jackson <ajax@redhat.com>
    Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>

Fixes #1009
  • Loading branch information
uli42 authored and sunweaver committed Jun 8, 2021
1 parent 1bd98ef commit a14e1a5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions nx-X11/programs/Xserver/randr/rrscreen.c
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ RREditConnectionInfo(ScreenPtr pScreen)
int screen = 0;
int d;

if (ConnectionInfo == NULL)
return;

connSetup = (xConnSetup *) ConnectionInfo;
vendor = (char *) connSetup + sizeof(xConnSetup);
formats = (xPixmapFormat *) ((char *) vendor +
Expand Down

0 comments on commit a14e1a5

Please sign in to comment.