mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2025-12-30 05:00:07 +01:00
Fix screen number checks.
screenInfo.numScreens is not a valid screen number, they go from 0 to
numScreens - 1.
Signed-off-by: Cyril Brulebois <kibi@debian.org>
Reviewed-by: Alex Deucher <alexdeucher@gmail.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
(cherry picked from commit 279ef1ffd7)
This commit is contained in:
parent
e2960ce14e
commit
e720e0874e
3 changed files with 5 additions and 5 deletions
|
|
@ -1536,7 +1536,7 @@ int __glXGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
|
|||
int i, p;
|
||||
|
||||
screen = req->screen;
|
||||
if (screen > screenInfo.numScreens) {
|
||||
if (screen >= screenInfo.numScreens) {
|
||||
/* The client library must send a valid screen number. */
|
||||
client->errorValue = screen;
|
||||
return BadValue;
|
||||
|
|
@ -2685,7 +2685,7 @@ int __glXGetFBConfigs(__GLXclientState *cl, GLbyte *pc)
|
|||
int numFBConfigs, i, p;
|
||||
__GLXscreenInfo *pGlxScreen;
|
||||
|
||||
if (screen > screenInfo.numScreens) {
|
||||
if (screen >= screenInfo.numScreens) {
|
||||
/* The client library must send a valid screen number. */
|
||||
client->errorValue = screen;
|
||||
return BadValue;
|
||||
|
|
@ -3107,7 +3107,7 @@ int __glXCreatePbuffer(__GLXclientState *cl, GLbyte *pc)
|
|||
/*
|
||||
** Look up screen and FBConfig.
|
||||
*/
|
||||
if (screen > screenInfo.numScreens) {
|
||||
if (screen >= screenInfo.numScreens) {
|
||||
/* The client library must send a valid screen number. */
|
||||
client->errorValue = screen;
|
||||
return BadValue;
|
||||
|
|
|
|||
|
|
@ -252,7 +252,7 @@ int __glXSwapGetVisualConfigs(__GLXclientState *cl, GLbyte *pc)
|
|||
|
||||
__GLX_SWAP_INT(&req->screen);
|
||||
screen = req->screen;
|
||||
if (screen > screenInfo.numScreens) {
|
||||
if (screen >= screenInfo.numScreens) {
|
||||
/* The client library must send a valid screen number. */
|
||||
client->errorValue = screen;
|
||||
return BadValue;
|
||||
|
|
|
|||
|
|
@ -473,7 +473,7 @@ EphyrDuplicateVisual (unsigned int a_screen,
|
|||
int i=0 ;
|
||||
|
||||
EPHYR_LOG ("enter\n") ;
|
||||
if (a_screen > screenInfo.numScreens) {
|
||||
if (a_screen >= screenInfo.numScreens) {
|
||||
EPHYR_LOG_ERROR ("bad screen number\n") ;
|
||||
goto out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue