mirror of
https://github.com/X11Libre/xserver.git
synced 2026-04-14 17:18:09 +00:00
glx: Fix potential crashes in glXWait{GL,X}
glxc->drawPriv will be NULL if the context is direct, or if it is current but without a bound drawable. Mesa's libGL won't normally emit protocol for direct contexts for these calls, but a malign client could still crash the server.
This commit is contained in:
@@ -765,7 +765,7 @@ __glXDisp_WaitGL(__GLXclientState * cl, GLbyte * pc)
|
||||
glFinish();
|
||||
}
|
||||
|
||||
if (glxc && glxc->drawPriv->waitGL)
|
||||
if (glxc && glxc->drawPriv && glxc->drawPriv->waitGL)
|
||||
(*glxc->drawPriv->waitGL) (glxc->drawPriv);
|
||||
|
||||
return Success;
|
||||
@@ -789,7 +789,7 @@ __glXDisp_WaitX(__GLXclientState * cl, GLbyte * pc)
|
||||
return error;
|
||||
}
|
||||
|
||||
if (glxc && glxc->drawPriv->waitX)
|
||||
if (glxc && glxc->drawPriv && glxc->drawPriv->waitX)
|
||||
(*glxc->drawPriv->waitX) (glxc->drawPriv);
|
||||
|
||||
return Success;
|
||||
|
||||
Reference in New Issue
Block a user