XQuartz: Validate screen in AppleDRIQueryDirectRenderingCapable requests

Return an error to the caller rather than crashing the server on
invalid screens.

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
Jeremy Huddleston Sequoia 2014-01-01 10:39:56 -08:00
parent 959e8f23af
commit b3572c0d1a

View File

@ -123,6 +123,10 @@ ProcAppleDRIQueryDirectRenderingCapable(register ClientPtr client)
rep.length = 0;
rep.sequenceNumber = client->sequence;
if (stuff->screen >= screenInfo.numScreens) {
return BadValue;
}
if (!DRIQueryDirectRenderingCapable(screenInfo.screens[stuff->screen],
&isCapable)) {
return BadValue;