mirror of
https://github.com/X11Libre/xserver.git
synced 2026-03-23 23:30:02 +00:00
xf86: check return value of XF86_CRTC_CONFIG_PTR in xf86CompatOutput()
If privates[xf86CrtcConfigPrivateIndex].ptr is NULL, this will cause a segfault. Possible fix for https://gitlab.freedesktop.org/xorg/xserver/-/issues/1241 Signed-off-by: Benjamin Valentin <benjamin.valentin@ml-pa.com> Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/835>
This commit is contained in:
committed by
Enrico Weigelt
parent
3ac5886879
commit
7ffd763439
@@ -842,7 +842,7 @@ xf86CompatOutput(ScrnInfoPtr pScrn)
|
||||
if (xf86CrtcConfigPrivateIndex == -1)
|
||||
return NULL;
|
||||
config = XF86_CRTC_CONFIG_PTR(pScrn);
|
||||
if (config->compat_output < 0)
|
||||
if ((config == NULL) || (config->compat_output < 0))
|
||||
return NULL;
|
||||
return config->output[config->compat_output];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user