diff options
author | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-01 10:39:56 -0800 |
---|---|---|
committer | Jeremy Huddleston Sequoia <jeremyhu@apple.com> | 2014-01-12 23:12:48 -0800 |
commit | b3572c0d1ab7888ac26d6b2b8be6d1d19ed9af3f (patch) | |
tree | 1554c52a14c431cae26136884a45a5cb6eed89ff /hw/xquartz | |
parent | 959e8f23af7850fcaf40d6c67f5228241a36a9ab (diff) |
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>
Diffstat (limited to 'hw/xquartz')
-rw-r--r-- | hw/xquartz/xpr/appledri.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/hw/xquartz/xpr/appledri.c b/hw/xquartz/xpr/appledri.c index 9aac07240..d7e984467 100644 --- a/hw/xquartz/xpr/appledri.c +++ b/hw/xquartz/xpr/appledri.c @@ -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; |