Skip to content
Snippets Groups Projects
Forked from xorg / xserver
2801 commits behind, 99 commits ahead of the upstream repository.
Alex Goins's avatar
Alex Goins authored
Similar to change cba5a10f, xf86ScreenSetCursor() would dereference ScreenPriv
without NULL checking it. If Option "SWCursor" is specified, ScreenPriv == NULL.

Without this fix, it is observed that setting Option "SWCursor" "on" on the
modesetting driver in a PRIME configuration will segfault the server.

It is important to return success rather than failure in the instance that
ScreenPriv == NULL and pCurs == NullCursor, because otherwise xf86SetCursor()
can fall into infinite recursion: xf86SetCursor(pCurs) calls
xf86ScreenSetCursor(pCurs), and if FALSE, calls xf86SetCursor(NullCursor). If
xf86ScreenSetCursor(NullCursor) returns FALSE, it calls
xf86SetCursor(NullCursor) again and this repeats forever.

Signed-off-by: default avatarAlex Goins <agoins@nvidia.com>
Reviewed-by: default avatarDave Airlie <airlied@redhat.com>
68d95e75
History
Name Last commit Last update
..