[PATCH 1/5] glx: make sure screen is non-negative in validGlxScreen

Julien Cristau jcristau at debian.org
Mon Jan 3 12:08:06 PST 2011


Reviewed-by: Adam Jackson <ajax at redhat.com>
Signed-off-by: Julien Cristau <jcristau at debian.org>
---
 glx/glxcmds.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/glx/glxcmds.c b/glx/glxcmds.c
index de9c3f0..419cc46 100644
--- a/glx/glxcmds.c
+++ b/glx/glxcmds.c
@@ -56,7 +56,7 @@ validGlxScreen(ClientPtr client, int screen, __GLXscreen **pGlxScreen, int *err)
     /*
     ** Check if screen exists.
     */
-    if (screen >= screenInfo.numScreens) {
+    if (screen < 0 || screen >= screenInfo.numScreens) {
 	client->errorValue = screen;
 	*err = BadValue;
 	return FALSE;
-- 
1.7.2.3



More information about the xorg-devel mailing list