mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-24 08:04:30 +00:00
dix: protect from pScreen->SetCursorPosition == NULL
It's safer not relying on all ScreenProc's actually filled.
../dix/events.c: In function ‘CheckPhysLimits’:
../dix/events.c:780:14: warning: dereference of NULL ‘pScreen’ [CWE-476] [-Wanalyzer-null-dereference]
780 | (*pScreen->SetCursorPosition)
| ~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signed-off-by: Enrico Weigelt, metux IT consult <info@metux.net>
This commit is contained in:
@@ -330,7 +330,8 @@ xf86RandRSetConfig(ScreenPtr pScreen,
|
||||
view_adjusted = TRUE;
|
||||
}
|
||||
|
||||
(*pScreen->SetCursorPosition) (dev, pScreen, px, py, FALSE);
|
||||
if (pScreen->SetCursorPosition)
|
||||
pScreen->SetCursorPosition(dev, pScreen, px, py, FALSE);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -2393,7 +2393,9 @@ DRIAdjustFrame(ScrnInfoPtr pScrn, int x, int y)
|
||||
py = pScrn->frameY0;
|
||||
if (py > pScrn->frameY1)
|
||||
py = pScrn->frameY1;
|
||||
pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE);
|
||||
|
||||
if (pScreen->SetCursorPosition)
|
||||
pScreen->SetCursorPosition(inputInfo.pointer, pScreen, px, py, TRUE);
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user