summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Goins <agoins@nvidia.com>2016-10-26 11:03:49 -0700
committerKeith Packard <keithp@keithp.com>2016-10-28 08:17:21 -0700
commitcba5a10fd93310702cad9dbe1e6d48da99f5552f (patch)
tree7b1263ba090bf3f61ec655fdcbd49357b3248ecb
parent5cb328338684d8e5b03913c47475bfcd7acffec4 (diff)
ramdac: Check sPriv != NULL in xf86CheckHWCursor()
xf86CheckHWCursor() would dereference sPriv without NULL checking it. If Option "SWCursor" is specified, sPriv == NULL. In this case we should assume that HW cursors are not supported. Signed-off-by: Alex Goins <agoins@nvidia.com> Reviewed-by: Andy Ritger <aritger@nvidia.com> Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--hw/xfree86/ramdac/xf86HWCurs.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xfree86/ramdac/xf86HWCurs.c b/hw/xfree86/ramdac/xf86HWCurs.c
index da2b18101..448132095 100644
--- a/hw/xfree86/ramdac/xf86HWCurs.c
+++ b/hw/xfree86/ramdac/xf86HWCurs.c
@@ -148,6 +148,10 @@ xf86CheckHWCursor(ScreenPtr pScreen, CursorPtr cursor, xf86CursorInfoPtr infoPtr
continue;
sPriv = dixLookupPrivate(&pSlave->devPrivates, xf86CursorScreenKey);
+ if (!sPriv) /* NULL if Option "SWCursor", possibly other conditions */
+ return FALSE;
+
+ /* FALSE if HWCursor not supported by slave */
if (!xf86ScreenCheckHWCursor(pSlave, cursor, sPriv->CursorInfoPtr))
return FALSE;
}